* **************************************************************************** *
* Sierra Leone - Social Signaling and Childhood Immunization
* The Effect of Signals on Beliefs about Other Children's Vaccinations
* **************************************************************************** *
/*
** Purpose:  Generates Figure :
The Effect of Signals on Beliefs about Other Children's Vaccinations


*/
* **************************************************************************** *
* **************************************************************************** *


	* Set format and style of the graph:
	cap graph drop _all
	cd   "${Replicate_SocialSignals_Out}/colorschemes/"
	grstyle init beliefs, replace
	grstyle set plain
	grstyle set legend, klength(small) nobox


	
	* ----------------------------------------------------------------------------

	use  "${Replicate_SocialSignals_dtaInter}/FirstOrderBeliefs_Truth_Constructed.dta", clear


	* ****************************************************************************
	* Truth - Measles1
	* ****************************************************************************


	* Generate clinic-level mean Measles 1 immunization rates
	bys   clinic: egen mean_m1 = mean(measles1_u1)    if age_u1>=274 & age_u1<=365

	foreach var in m1  {
		sum mean_`var' if age_u1>=274 & age_u1<=365, detail  
		gen `var'_dm           = mean_`var'   - `r(mean)'   if age_u1>=274 & age_u1<=365 
	}


	** Comparison of Uninformative, Signal 4th and 5th bracelet
	local   ControlVars = "mother_age_w01 age_u1 edu2 edu3 farm birth2 birth3 birth4 birth5 relate"

	* For 9 - 12 months
	foreach control of local ControlVars  {
		sum `control' if age_u1>=274 & age_u1<=365, detail
		gen    `control'_dm_m1    = `control' -`r(mean)'            if age_u1>=274 & age_u1<=365
	}

	foreach var in strat2 strat3 strat4 strat5 strat6 strat7 strat8 anc2 anc3 anc4 {
		sum `var'   if age_u1>=274 & age_u1<=365, detail
		gen   `var'_dm_m1     = `var' - `r(mean)'           if age_u1>=274 & age_u1<=365
	}



	** Green bracelet
	* Code a green and measles 1 indicator:
	gen     green_m1      = 1             if num_color==8 & age_u1>=274 & age_u1<=365
	replace green_m1      = 0             if num_color!=8 & num_color!=. & age_u1>=274 & age_u1<=365

	* Code a green, but NOT measles 1 indicator:
	gen     green_not_m1  = 1             if inlist(num_color,5,6,7) & age_u1>=274 & age_u1<=365
	replace green_not_m1  = 0             if inlist(num_color,1,2,3,4,8) & age_u1>=274 & age_u1<=365


	** Yellow
	gen     yellow_m1     = 1             if num_color==4 & age_u1>=274 & age_u1<=365
	replace yellow_m1     = 0             if num_color!=4 & num_color!=. & age_u1>=274 & age_u1<=365

	gen     yellow_not_m1 = 1             if inlist(num_color,1,2,3) & age_u1>=274 & age_u1<=365
	replace yellow_not_m1 = 0             if inlist(num_color,4,5,6,7,8) & age_u1>=274 & age_u1<=365



	* ******************************************************************************
	* Truth - Penta3
	* ******************************************************************************


	bys clinic: egen mean_p3 = mean(penta3_u1)                     if age_u1>=107&age_u1< 274

	foreach var in p3  {
		sum mean_`var' if age_u1>=107&age_u1< 274, detail
		gen `var'_dm = mean_`var' - `r(mean)'          if age_u1>=107&age_u1< 274
	}


	**Comparison of Uninformative, Signal 4th and 5th bracelet
	local   ControlVars = "mother_age_w01 age_u1 edu2 edu3 farm birth2 birth3 birth4 birth5 relate"

	* For 3.5 - 9 months
	foreach control of local ControlVars  {
		sum `control' if age_u1>=107&age_u1< 274, detail
		gen    `control'_dm_p3    = `control' - `r(mean)'          if age_u1>=107&age_u1< 274
	}

	foreach var in strat1 strat2 strat3 strat4 strat5 strat6 strat7 strat8 anc2 anc3 anc4 {
		sum `var' if age_u1>=107&age_u1< 274, detail
		gen `var'_dm_p3    = `var' - `r(mean)'   if age_u1>=107&age_u1< 274
	}


	** Green
	* if 4 or 5 vaccines and a green:
	gen     green_p3     = 1           if inlist(num_color,7,8)       & age_u1>=107&age_u1< 274
	replace green_p3     = 0           if (num_color!=7&num_color!=8) & num_color!=.  & age_u1>=107&age_u1< 274

	* if less than 4 vaccines and a green:
	gen     green_not_p3 = 1           if inlist(num_color,5,6)  & age_u1>=107&age_u1< 274
	replace green_not_p3 = 0           if inlist(num_color,1,2,3,4,7,8)  & age_u1>=107&age_u1< 274


	** Yellow
	* If 4 or 5 vaccines and a yellow
	gen     yellow_p3    = 1           if inlist(num_color,3,4) & age_u1>=107&age_u1< 274
	replace yellow_p3    = 0           if (num_color!=3&num_color!=4) & num_color!=.& age_u1>=107&age_u1< 274

	* If less than 4 vaccines and a yellow
	gen     yellow_not_p3 = 1          if inlist(num_color,1,2) & age_u1>=107&age_u1< 274
	replace yellow_not_p3 = 0          if inlist(num_color,3,4,5,6,7,8) & age_u1>=107&age_u1< 274


	********************************************************************************
	* Truth - Generate a table with all results combined:


	* Test for Vaccine 5, whether delta Green - Yellow is significant different from
	*    each other across arms


	local ControlVars_P3 = " mother_age_w01_dm_p3 age_u1_dm_p3 edu2_dm_p3 edu3_dm_p3 farm_dm_p3 birth2_dm_p3 birth3_dm_p3 birth4_dm_p3 birth5_dm_p3 relate_dm_p3 p3_dm"
	local StrataVars_P3  = " strat2_dm_p3 strat3_dm_p3 strat4_dm_p3 strat5_dm_p3 strat6_dm_p3 strat7_dm_p3 strat8_dm_p3 "
	local ANCVars_P3     = " anc2_dm_p3 anc3_dm_p3 anc4_dm_p3 "

	local ControlVars_M1 = " mother_age_w01_dm_m1  age_u1_dm_m1 edu2_dm_m1 edu3_dm_m1 farm_dm_m1 birth2_dm_m1 birth3_dm_m1 birth4_dm_m1 birth5_dm_m1 relate_dm_m1 m1_dm"
	local StrataVars_M1  = " strat2_dm_m1 strat3_dm_m1 strat4_dm_m1 strat5_dm_m1 strat6_dm_m1 strat7_dm_m1 strat8_dm_m1 "
	local ANCVars_M1     = " anc2_dm_m1 anc3_dm_m1 anc4_dm_m1  "


	* ------------------------------------------------------------------------------
	* Truth - Penta 3
	* ------------------------------------------------------------------------------


	reg    green_p3     treat3 treat4
	estimates store green_p3_ui_reg
	reg    green_not_p3 treat3 treat4
	estimates store green_not_p3_ui_reg

	reg    yellow_p3 treat3 treat4
	estimates store yellow_p3_ui_reg
	reg    yellow_not_p3 treat3 treat4
	estimates store yellow_not_p3_ui_reg

	* Compare for Signal at 4:
	reg   green_p3 treat3 treat4
	estimates store green_p3_s4_reg
	reg   green_not_p3 treat3 treat4
	estimates store green_not_p3_s4_reg

	reg   yellow_p3 treat3 treat4
	estimates store yellow_p3_s4_reg
	reg   yellow_not_p3 treat3 treat4
	estimates store yellow_not_p3_s4_reg

	* Compare for Signal at 5:
	reg   green_p3 treat3 treat4
	estimates store green_p3_s5_reg
	reg   green_not_p3 treat3 treat4
	estimates store green_not_p3_s5_reg

	reg   yellow_p3 treat3 treat4
	estimates store yellow_p3_s5_reg
	reg   yellow_not_p3 treat3 treat4
	estimates store yellow_not_p3_s5_reg


	* ------------------------------------------------------------------------------
	* Truth - Penta 3 - YELLOW
	* ------------------------------------------------------------------------------

	local  model_p3_ui " green_p3_ui_reg  green_not_p3_ui_reg  yellow_p3_ui_reg  yellow_not_p3_ui_reg "
	local  model_p3_s4 " green_p3_s4_reg  green_not_p3_s4_reg  yellow_p3_s4_reg  yellow_not_p3_s4_reg "
	local  model_p3_s5 " green_p3_s5_reg  green_not_p3_s5_reg  yellow_p3_s5_reg  yellow_not_p3_s5_reg "

	suest `model_p3_ui' `model_p3_s4' `model_p3_s5', vce(cluster clinic)

	nlcom ///
	(ui: ([yellow_p3_ui_reg_mean]_cons)/([yellow_p3_ui_reg_mean]_cons+[yellow_not_p3_ui_reg_mean]_cons)) ///
	(s4: ([yellow_p3_s4_reg_mean]treat3+[yellow_p3_s4_reg_mean]_cons)/([yellow_p3_s4_reg_mean]treat3+[yellow_p3_s4_reg_mean]_cons+[yellow_not_p3_s4_reg_mean]treat3+[yellow_not_p3_s4_reg_mean]_cons))   ///
	(s5: ([yellow_p3_s5_reg_mean]treat4+[yellow_p3_s5_reg_mean]_cons)/([yellow_p3_s5_reg_mean]treat4+[yellow_p3_s5_reg_mean]_cons+[yellow_not_p3_s5_reg_mean]treat4+[yellow_not_p3_s5_reg_mean]_cons)), post
	estadd local Obs = "`r(N)'"
	test   _b[ui] = _b[s4]
	estadd scalar ui_s4 = r(p)
	test   _b[ui] = _b[s5]
	estadd scalar ui_s5 = r(p)
	test   _b[s4] = _b[s5]
	estadd scalar s4_s5 = r(p)
	estadd local controls = "Yes"
	eststo m_truth_p3_yellow


	* Store estimates to plot:
	gen    est_p3_yellow_ui   = _b[ui]                            if intervention_arm == 2 & baby_color == 2 & yellow_p3 == 1
	gen    ci_hi_p3_yellow_ui = est_p3_yellow_ui + 1.96*_se[ui]   if intervention_arm == 2 & baby_color == 2 & yellow_p3 == 1
	gen    ci_lo_p3_yellow_ui = est_p3_yellow_ui - 1.96*_se[ui]   if intervention_arm == 2 & baby_color == 2 & yellow_p3 == 1

	gen    est_p3_yellow_s4   = _b[s4]                            if intervention_arm == 3 & baby_color == 2 & yellow_p3 == 1
	gen    ci_hi_p3_yellow_s4 = est_p3_yellow_s4 + 1.96*_se[s4]   if intervention_arm == 3 & baby_color == 2 & yellow_p3 == 1
	gen    ci_lo_p3_yellow_s4 = est_p3_yellow_s4 - 1.96*_se[s4]   if intervention_arm == 3 & baby_color == 2 & yellow_p3 == 1

	gen    est_p3_yellow_s5   = _b[s5]                            if intervention_arm == 4 & baby_color == 2 & yellow_p3 == 1
	gen    ci_hi_p3_yellow_s5 = est_p3_yellow_s5 + 1.96*_se[s5]   if intervention_arm == 4 & baby_color == 2 & yellow_p3 == 1
	gen    ci_lo_p3_yellow_s5 = est_p3_yellow_s5 - 1.96*_se[s5]   if intervention_arm == 4 & baby_color == 2 & yellow_p3 == 1


	* ------------------------------------------------------------------------------
	* Truth - Penta 3:  GREEN
	* ------------------------------------------------------------------------------


	local  model_p3_ui " green_p3_ui_reg  green_not_p3_ui_reg  yellow_p3_ui_reg  yellow_not_p3_ui_reg "
	local  model_p3_s4 " green_p3_s4_reg  green_not_p3_s4_reg  yellow_p3_s4_reg  yellow_not_p3_s4_reg "
	local  model_p3_s5 " green_p3_s5_reg  green_not_p3_s5_reg  yellow_p3_s5_reg  yellow_not_p3_s5_reg "

	suest `model_p3_ui' `model_p3_s4' `model_p3_s5', vce(cluster clinic)

	nlcom ///
	(ui: ([green_p3_ui_reg_mean]_cons)/([green_p3_ui_reg_mean]_cons+[green_not_p3_s4_reg_mean]_cons) ) ///
	(s4: ([green_p3_s4_reg_mean]treat3+[green_p3_s4_reg_mean]_cons)/([green_p3_s4_reg_mean]treat3+[green_p3_s4_reg_mean]_cons+[green_not_p3_s4_reg_mean]treat3+[green_not_p3_s4_reg_mean]_cons) )   ///
	(s5: ([green_p3_s5_reg_mean]treat4+[green_p3_s5_reg_mean]_cons)/([green_p3_s5_reg_mean]treat4+[green_p3_s5_reg_mean]_cons+[green_not_p3_s5_reg_mean]treat4+[green_not_p3_s5_reg_mean]_cons) ), post
	estadd local Obs  = "`r(N)'"
	test   _b[ui] = _b[s4]
	estadd scalar ui_s4 = r(p)
	test   _b[ui] = _b[s5]
	estadd scalar ui_s5 = r(p)
	test   _b[s4] = _b[s5]
	estadd scalar s4_s5 = r(p)
	estadd local controls = "Yes"
	eststo m_truth_p3_green


	* Store estimate to plot
	gen    est_p3_green_ui   = _b[ui]                            if intervention_arm == 2 & baby_color == 1 & green_p3 == 1
	gen    ci_hi_p3_green_ui = est_p3_green_ui + 1.96*_se[ui]    if intervention_arm == 2 & baby_color == 1 & green_p3 == 1
	gen    ci_lo_p3_green_ui = est_p3_green_ui - 1.96*_se[ui]    if intervention_arm == 2 & baby_color == 1 & green_p3 == 1

	gen    est_p3_green_s4   = _b[s4]                            if intervention_arm == 3 & baby_color == 1 & green_p3 == 1
	gen    ci_hi_p3_green_s4 = est_p3_green_s4 + 1.96*_se[s4]    if intervention_arm == 3 & baby_color == 1 & green_p3 == 1
	gen    ci_lo_p3_green_s4 = est_p3_green_s4 - 1.96*_se[s4]    if intervention_arm == 3 & baby_color == 1 & green_p3 == 1

	gen    est_p3_green_s5   = _b[s5]                            if intervention_arm == 4 & baby_color == 1 & green_p3 == 1
	gen    ci_hi_p3_green_s5 = est_p3_green_s5 + 1.96*_se[s5]    if intervention_arm == 4 & baby_color == 1 & green_p3 == 1
	gen    ci_lo_p3_green_s5 = est_p3_green_s5 - 1.96*_se[s5]    if intervention_arm == 4 & baby_color == 1 & green_p3 == 1


	* ------------------------------------------------------------------------------
	* Truth - Penta 3: - Difference between YELLOW - Green
	* ------------------------------------------------------------------------------

	local  model_p3_ui " green_p3_ui_reg  green_not_p3_ui_reg  yellow_p3_ui_reg  yellow_not_p3_ui_reg "
	local  model_p3_s4 " green_p3_s4_reg  green_not_p3_s4_reg  yellow_p3_s4_reg  yellow_not_p3_s4_reg "
	local  model_p3_s5 " green_p3_s5_reg  green_not_p3_s5_reg  yellow_p3_s5_reg  yellow_not_p3_s5_reg "

	suest `model_p3_ui' `model_p3_s4' `model_p3_s5', vce(cluster clinic)

	nlcom ///
	(ui: ([green_p3_ui_reg_mean]_cons)/([green_p3_ui_reg_mean]_cons+[green_not_p3_s4_reg_mean]_cons) - ([yellow_p3_ui_reg_mean]_cons)/([yellow_p3_ui_reg_mean]_cons+[yellow_not_p3_ui_reg_mean]_cons) ) ///
	(s4: ([green_p3_s4_reg_mean]treat3+[green_p3_s4_reg_mean]_cons)/([green_p3_s4_reg_mean]treat3+[green_p3_s4_reg_mean]_cons+[green_not_p3_s4_reg_mean]treat3+[green_not_p3_s4_reg_mean]_cons) - ([yellow_p3_s4_reg_mean]treat3+[yellow_p3_s4_reg_mean]_cons)/([yellow_p3_s4_reg_mean]treat3+[yellow_p3_s4_reg_mean]_cons+[yellow_not_p3_s4_reg_mean]treat3+[yellow_not_p3_s4_reg_mean]_cons))   ///
	(s5: ([green_p3_s5_reg_mean]treat4+[green_p3_s5_reg_mean]_cons)/([green_p3_s5_reg_mean]treat4+[green_p3_s5_reg_mean]_cons+[green_not_p3_s5_reg_mean]treat4+[green_not_p3_s5_reg_mean]_cons) - ([yellow_p3_s5_reg_mean]treat4+[yellow_p3_s5_reg_mean]_cons)/([yellow_p3_s5_reg_mean]treat4+[yellow_p3_s5_reg_mean]_cons+[yellow_not_p3_s5_reg_mean]treat4+[yellow_not_p3_s5_reg_mean]_cons)), post
	estadd local Obs  = "`r(N)'"
	test   _b[ui] = _b[s4]
	estadd scalar ui_s4  = r(p)
	local  p3_pval_ui_s4 = r(p)
	test   _b[ui] = _b[s5]
	estadd scalar ui_s5  = r(p)
	local  p3_pval_ui_s5 = r(p)
	test   _b[s4] = _b[s5]
	estadd scalar s4_s5 = r(p)
	estadd local controls = "Yes"
	eststo m_truth_p3_diff


	gen    delta_p3_ui = abs(_b[ui])       if intervention_arm == 2
	gen    delta_p3_s4 = abs(_b[s4])       if intervention_arm == 3
	gen    delta_p3_s5 = abs(_b[s5])       if intervention_arm == 4


	* Pull Signifcance Levels for the figure:

	* Uninformative:
	suest `model_p3_ui' `model_p3_s4' `model_p3_s5', vce(cluster clinic)

	nlcom ///
	(ui: ([yellow_p3_ui_reg_mean]_cons)/([yellow_p3_ui_reg_mean]_cons+[yellow_not_p3_ui_reg_mean]_cons) - ([green_p3_ui_reg_mean]_cons)/([green_p3_ui_reg_mean]_cons+[green_not_p3_s4_reg_mean]_cons) ), post

	matrix b = r(b)
	matrix V = r(V)
	local  std_err = sqrt(V[1,1])
	local  z       = b[1,1]/`std_err'
	local  pvalue_p3_uni = 2*normal(-abs(`z'))

	* Store based on the levels of significance the stars:
	if   `pvalue_p3_uni' < 0.10 {
		local sig_p3_uni = "*"
	}
	if   `pvalue_p3_uni' < 0.05 {
		local sig_p3_uni = "**"
	}
	if   `pvalue_p3_uni' < 0.01 {
		local sig_p3_uni = "***"
	}

	dis  "`sig_p3_uni'"

	local b_p3_uni: di %3.2f _b[ui]
	di   `b_p3_uni'


	* Signal at 4:
	suest `model_p3_ui' `model_p3_s4' `model_p3_s5', vce(cluster clinic)

	nlcom ///
	(s4: ([yellow_p3_s4_reg_mean]treat3+[yellow_p3_s4_reg_mean]_cons)/([yellow_p3_s4_reg_mean]treat3+[yellow_p3_s4_reg_mean]_cons+[yellow_not_p3_s4_reg_mean]treat3+[yellow_not_p3_s4_reg_mean]_cons) - ([green_p3_s4_reg_mean]treat3+[green_p3_s4_reg_mean]_cons)/([green_p3_s4_reg_mean]treat3+[green_p3_s4_reg_mean]_cons+[green_not_p3_s4_reg_mean]treat3+[green_not_p3_s4_reg_mean]_cons) ), post

	matrix b = r(b)
	matrix V = r(V)
	local  std_err = sqrt(V[1,1])
	local  z       = b[1,1]/`std_err'
	local  pvalue_p3_s4 = 2*normal(-abs(`z'))

	* Store based on the levels of significance the stars:
	if   `pvalue_p3_s4' < 0.10 {
		local sig_p3_s4 = "*"
	}
	if   `pvalue_p3_s4' < 0.05 {
		local sig_p3_s4 = "**"
	}
	if   `pvalue_p3_s4' < 0.01 {
		local sig_p3_s4 = "***"
	}

	dis  "`sig_p3_s4'"

	local b_p3_s4: di %3.2f _b[s4]
	di   `b_p3_s4'



	* Signal at 5:
	suest `model_p3_ui' `model_p3_s4' `model_p3_s5', vce(cluster clinic)

	nlcom ///
	(s5: ([yellow_p3_s5_reg_mean]treat4+[yellow_p3_s5_reg_mean]_cons)/([yellow_p3_s5_reg_mean]treat4+[yellow_p3_s5_reg_mean]_cons+[yellow_not_p3_s5_reg_mean]treat4+[yellow_not_p3_s5_reg_mean]_cons) - ([green_p3_s5_reg_mean]treat4+[green_p3_s5_reg_mean]_cons)/([green_p3_s5_reg_mean]treat4+[green_p3_s5_reg_mean]_cons+[green_not_p3_s5_reg_mean]treat4+[green_not_p3_s5_reg_mean]_cons) ), post

	matrix b = r(b)
	matrix V = r(V)
	local  std_err = sqrt(V[1,1])
	local  z       = b[1,1]/`std_err'
	local  pvalue_p3_s5 = 2*normal(-abs(`z'))

	* Store based on the levels of significance the stars:
	if   `pvalue_p3_s5' < 0.10 {
		local sig_p3_s5 = "*"
	}
	if   `pvalue_p3_s5' < 0.05 {
		local sig_p3_s5 = "**"
	}
	if   `pvalue_p3_s5' < 0.01 {
		local sig_p3_s5 = "***"
	}

	dis  "`sig_p3_s5'"

	local b_p3_s5: di %3.2f _b[s5]
	di   `b_p3_s5'



	* ------------------------------------------------------------------------------
	* Truth - Measles 1
	* ------------------------------------------------------------------------------


	** for Uninformative:
	reg    green_m1       treat3 treat4
	estimates store green_m1_ui_reg
	reg    green_not_m1   treat3 treat4
	estimates store green_not_m1_ui_reg

	reg    yellow_m1    treat3 treat4
	estimates store  yellow_m1_ui_reg
	reg    yellow_not_m1 treat3 treat4
	estimates store  yellow_not_m1_ui_reg

	** for Signal at 4:
	reg    green_m1    treat3 treat4
	estimates store  green_m1_s4_reg
	reg    green_not_m1 treat3 treat4
	estimates store  green_not_m1_s4_reg

	reg    yellow_m1    treat3 treat4
	estimates store  yellow_m1_s4_reg
	reg    yellow_not_m1 treat3 treat4
	estimates store  yellow_not_m1_s4_reg

	** for Signal at 5:
	reg    green_m1    treat3 treat4
	estimates store  green_m1_s5_reg
	reg    green_not_m1 treat3 treat4
	estimates store  green_not_m1_s5_reg

	reg    yellow_m1    treat3 treat4
	estimates store  yellow_m1_s5_reg
	reg    yellow_not_m1 treat3 treat4
	estimates store  yellow_not_m1_s5_reg


	* ------------------------------------------------------------------------------
	* Truth - Measles 1 - YELLOW
	* ------------------------------------------------------------------------------

	local  model_m1_ui " green_m1_ui_reg green_not_m1_ui_reg yellow_m1_ui_reg yellow_not_m1_ui_reg "
	local  model_m1_s4 " green_m1_s4_reg green_not_m1_s4_reg yellow_m1_s4_reg yellow_not_m1_s4_reg "
	local  model_m1_s5 " green_m1_s5_reg green_not_m1_s5_reg yellow_m1_s5_reg yellow_not_m1_s5_reg "

	suest `model_m1_ui' `model_m1_s4' `model_m1_s5', vce(cluster clinic)

	nlcom ///
	(ui: ([yellow_m1_ui_reg_mean]_cons)/([yellow_m1_ui_reg_mean]_cons+[yellow_not_m1_ui_reg_mean]_cons)) ///
	(s4: ([yellow_m1_s4_reg_mean]treat3+[yellow_m1_s4_reg_mean]_cons)/([yellow_m1_s4_reg_mean]treat3+[yellow_m1_s4_reg_mean]_cons+[yellow_not_m1_s4_reg_mean]treat3+[yellow_not_m1_s4_reg_mean]_cons))   ///
	(s5: ([yellow_m1_s5_reg_mean]treat4+[yellow_m1_s5_reg_mean]_cons)/([yellow_m1_s5_reg_mean]treat4+[yellow_m1_s5_reg_mean]_cons+[yellow_not_m1_s5_reg_mean]treat4+[yellow_not_m1_s5_reg_mean]_cons)), post
	estadd local Obs  = "`r(N)'"
	test   _b[ui] = _b[s4]
	estadd scalar ui_s4 = r(p)
	test   _b[ui] = _b[s5]
	estadd scalar ui_s5 = r(p)
	test   _b[s4] = _b[s5]
	estadd scalar s4_s5 = r(p)
	estadd local controls = "Yes"
	eststo m_truth_m1_yellow



	* Store estimates to plot:
	gen    est_m1_yellow_ui   = _b[ui]                            if intervention_arm == 2 & baby_color == 2 & yellow_m1 == 1
	gen    ci_hi_m1_yellow_ui = est_m1_yellow_ui + 1.96*_se[ui]   if intervention_arm == 2 & baby_color == 2 & yellow_m1 == 1
	gen    ci_lo_m1_yellow_ui = est_m1_yellow_ui - 1.96*_se[ui]   if intervention_arm == 2 & baby_color == 2 & yellow_m1 == 1

	gen    est_m1_yellow_s4   = _b[s4]                            if intervention_arm == 3 & baby_color == 2 & yellow_m1 == 1
	gen    ci_hi_m1_yellow_s4 = est_m1_yellow_s4 + 1.96*_se[s4]   if intervention_arm == 3 & baby_color == 2 & yellow_m1 == 1
	gen    ci_lo_m1_yellow_s4 = est_m1_yellow_s4 - 1.96*_se[s4]   if intervention_arm == 3 & baby_color == 2 & yellow_m1 == 1

	gen    est_m1_yellow_s5   = _b[s5]                            if intervention_arm == 4 & baby_color == 2 & yellow_m1 == 1
	gen    ci_hi_m1_yellow_s5 = est_m1_yellow_s5 + 1.96*_se[s5]   if intervention_arm == 4 & baby_color == 2 & yellow_m1 == 1
	gen    ci_lo_m1_yellow_s5 = est_m1_yellow_s5 - 1.96*_se[s5]   if intervention_arm == 4 & baby_color == 2 & yellow_m1 == 1



	* ------------------------------------------------------------------------------
	* Truth - Measles 1 - GREEN
	* ------------------------------------------------------------------------------

	local  model_m1_ui " green_m1_ui_reg green_not_m1_ui_reg yellow_m1_ui_reg yellow_not_m1_ui_reg "
	local  model_m1_s4 " green_m1_s4_reg green_not_m1_s4_reg yellow_m1_s4_reg yellow_not_m1_s4_reg "
	local  model_m1_s5 " green_m1_s5_reg green_not_m1_s5_reg yellow_m1_s5_reg yellow_not_m1_s5_reg "

	suest `model_m1_ui' `model_m1_s4' `model_m1_s5', vce(cluster clinic)

	nlcom ///
	(ui: ([green_m1_ui_reg_mean]_cons)/([green_m1_ui_reg_mean]_cons+[green_not_m1_s4_reg_mean]_cons)) ///
	(s4: ([green_m1_s4_reg_mean]treat3+[green_m1_s4_reg_mean]_cons)/([green_m1_s4_reg_mean]treat3+[green_m1_s4_reg_mean]_cons+[green_not_m1_s4_reg_mean]treat3+[green_not_m1_s4_reg_mean]_cons))   ///
	(s5: ([green_m1_s5_reg_mean]treat4+[green_m1_s5_reg_mean]_cons)/([green_m1_s5_reg_mean]treat4+[green_m1_s5_reg_mean]_cons+[green_not_m1_s5_reg_mean]treat4+[green_not_m1_s5_reg_mean]_cons)), post
	estadd local Obs  = "`r(N)'"
	test   _b[ui] = _b[s4]
	estadd scalar ui_s4 = r(p)
	test   _b[ui] = _b[s5]
	estadd scalar ui_s5 = r(p)
	test   _b[s4] = _b[s5]
	estadd scalar s4_s5 = r(p)
	estadd local controls = "Yes"
	eststo m_truth_m1_green


	* Store estimate to plot
	gen    est_m1_green_ui   = _b[ui]                            if intervention_arm == 2 & baby_color == 1 & green_m1 == 1
	gen    ci_hi_m1_green_ui = est_m1_green_ui + 1.96*_se[ui]    if intervention_arm == 2 & baby_color == 1 & green_m1 == 1
	gen    ci_lo_m1_green_ui = est_m1_green_ui - 1.96*_se[ui]    if intervention_arm == 2 & baby_color == 1 & green_m1 == 1

	gen    est_m1_green_s4   = _b[s4]                            if intervention_arm == 3 & baby_color == 1 & green_m1 == 1
	gen    ci_hi_m1_green_s4 = est_m1_green_s4 + 1.96*_se[s4]    if intervention_arm == 3 & baby_color == 1 & green_m1 == 1
	gen    ci_lo_m1_green_s4 = est_m1_green_s4 - 1.96*_se[s4]    if intervention_arm == 3 & baby_color == 1 & green_m1 == 1

	gen    est_m1_green_s5   = _b[s5]                            if intervention_arm == 4 & baby_color == 1 & green_m1 == 1
	gen    ci_hi_m1_green_s5 = est_m1_green_s5 + 1.96*_se[s5]    if intervention_arm == 4 & baby_color == 1 & green_m1 == 1
	gen    ci_lo_m1_green_s5 = est_m1_green_s5 - 1.96*_se[s5]    if intervention_arm == 4 & baby_color == 1 & green_m1 == 1




	* ----------------------------------------------------------------------------
	* Truth - Measles 1  - Difference Between YELLOW - Green
	* ----------------------------------------------------------------------------


	local  model_m1_ui " green_m1_ui_reg green_not_m1_ui_reg yellow_m1_ui_reg yellow_not_m1_ui_reg "
	local  model_m1_s4 " green_m1_s4_reg green_not_m1_s4_reg yellow_m1_s4_reg yellow_not_m1_s4_reg "
	local  model_m1_s5 " green_m1_s5_reg green_not_m1_s5_reg yellow_m1_s5_reg yellow_not_m1_s5_reg "

	suest `model_m1_ui' `model_m1_s4' `model_m1_s5', vce(cluster clinic)

	nlcom ///
	(ui: ([green_m1_ui_reg_mean]_cons)/([green_m1_ui_reg_mean]_cons+[green_not_m1_s4_reg_mean]_cons) - ([yellow_m1_ui_reg_mean]_cons)/([yellow_m1_ui_reg_mean]_cons+[yellow_not_m1_ui_reg_mean]_cons) ) ///
	(s4: ([green_m1_s4_reg_mean]treat3+[green_m1_s4_reg_mean]_cons)/([green_m1_s4_reg_mean]treat3+[green_m1_s4_reg_mean]_cons+[green_not_m1_s4_reg_mean]treat3+[green_not_m1_s4_reg_mean]_cons) - ([yellow_m1_s4_reg_mean]treat3+[yellow_m1_s4_reg_mean]_cons)/([yellow_m1_s4_reg_mean]treat3+[yellow_m1_s4_reg_mean]_cons+[yellow_not_m1_s4_reg_mean]treat3+[yellow_not_m1_s4_reg_mean]_cons))   ///
	(s5: ([green_m1_s5_reg_mean]treat4+[green_m1_s5_reg_mean]_cons)/([green_m1_s5_reg_mean]treat4+[green_m1_s5_reg_mean]_cons+[green_not_m1_s5_reg_mean]treat4+[green_not_m1_s5_reg_mean]_cons) - ([yellow_m1_s5_reg_mean]treat4+[yellow_m1_s5_reg_mean]_cons)/([yellow_m1_s5_reg_mean]treat4+[yellow_m1_s5_reg_mean]_cons+[yellow_not_m1_s5_reg_mean]treat4+[yellow_not_m1_s5_reg_mean]_cons)), post
	estadd local Obs  = "`r(N)'"
	test   _b[ui] = _b[s4]
	estadd scalar ui_s4 = r(p)
	test   _b[ui] = _b[s5]
	estadd scalar ui_s5 = r(p)
	test   _b[s4] = _b[s5]
	estadd scalar s4_s5 = r(p)
	estadd local controls = "Yes"
	eststo m_truth_m1_diff

	* Store delta's for the figure:
	gen    delta_m1_ui = abs(_b[ui])       if intervention_arm == 2
	gen    delta_m1_s4 = abs(_b[s4])       if intervention_arm == 3
	gen    delta_m1_s5 = abs(_b[s5])       if intervention_arm == 4


	* Pull Signifcance Levels for the figure:

	* Uninformative:
	suest `model_m1_ui' `model_m1_s4' `model_m1_s5', vce(cluster clinic)

	nlcom ///
	(ui: ([yellow_m1_ui_reg_mean]_cons)/([yellow_m1_ui_reg_mean]_cons+[yellow_not_m1_ui_reg_mean]_cons) - ([green_m1_ui_reg_mean]_cons)/([green_m1_ui_reg_mean]_cons+[green_not_m1_s4_reg_mean]_cons) ), post

	matrix b = r(b)
	matrix V = r(V)
	local  std_err = sqrt(V[1,1])
	local  z       = b[1,1]/`std_err'
	local  pvalue_m1_uni = 2*normal(-abs(`z'))

	* Store based on the levels of significance the stars:
	if   `pvalue_m1_uni' < 0.10 {
		local sig_m1_uni = "*"
	}
	if   `pvalue_m1_uni' < 0.05 {
		local sig_m1_uni = "**"
	}
	if   `pvalue_m1_uni' < 0.01 {
		local sig_m1_uni = "***"
	}

	dis  "`sig_m1_uni'"

	local b_m1_uni: di %3.2f _b[ui]
	di   `b_m1_uni'


	* Signal at 4:
	suest `model_m1_ui' `model_m1_s4' `model_m1_s5', vce(cluster clinic)

	nlcom ///
	(s4: ([yellow_m1_s4_reg_mean]treat3+[yellow_m1_s4_reg_mean]_cons)/([yellow_m1_s4_reg_mean]treat3+[yellow_m1_s4_reg_mean]_cons+[yellow_not_m1_s4_reg_mean]treat3+[yellow_not_m1_s4_reg_mean]_cons) - ([green_m1_s4_reg_mean]treat3+[green_m1_s4_reg_mean]_cons)/([green_m1_s4_reg_mean]treat3+[green_m1_s4_reg_mean]_cons+[green_not_m1_s4_reg_mean]treat3+[green_not_m1_s4_reg_mean]_cons) ), post

	matrix b = r(b)
	matrix V = r(V)
	local  std_err = sqrt(V[1,1])
	local  z       = b[1,1]/`std_err'
	local  pvalue_m1_s4 = 2*normal(-abs(`z'))

	* Store based on the levels of significance the stars:
	if   `pvalue_m1_s4' < 0.10 {
		local sig_m1_s4 = "*"
	}
	if   `pvalue_m1_s4' < 0.05 {
		local sig_m1_s4 = "**"
	}
	if   `pvalue_m1_s4' < 0.01 {
		local sig_m1_s4 = "***"
	}

	dis  "`sig_m1_s4'"

	local b_m1_s4: di %3.2f _b[s4]
	di   `b_m1_s4'



	* Signal at 5:
	suest `model_m1_ui' `model_m1_s4' `model_m1_s5', vce(cluster clinic)

	nlcom ///
	(s5: ([yellow_m1_s5_reg_mean]treat4+[yellow_m1_s5_reg_mean]_cons)/([yellow_m1_s5_reg_mean]treat4+[yellow_m1_s5_reg_mean]_cons+[yellow_not_m1_s5_reg_mean]treat4+[yellow_not_m1_s5_reg_mean]_cons) - ([green_m1_s5_reg_mean]treat4+[green_m1_s5_reg_mean]_cons)/([green_m1_s5_reg_mean]treat4+[green_m1_s5_reg_mean]_cons+[green_not_m1_s5_reg_mean]treat4+[green_not_m1_s5_reg_mean]_cons) ), post

	matrix b = r(b)
	matrix V = r(V)
	local  std_err = sqrt(V[1,1])
	local  z       = b[1,1]/`std_err'
	local  pvalue_m1_s5 = 2*normal(-abs(`z'))

	* Store based on the levels of significance the stars:
	if   `pvalue_m1_s5' < 0.10 {
	local sig_m1_s5 = "*"
	}
	if   `pvalue_m1_s5' < 0.05 {
	local sig_m1_s5 = "**"
	}
	if   `pvalue_m1_s5' < 0.01 {
	local sig_m1_s5 = "***"
	}

	dis  "`sig_m1_s5'"

	local b_m1_s5: di %3.2f _b[s5]
	di   `b_m1_s5'




	* ******************************************************************************
	* Truth - Generate Figure and Tables:
	* ******************************************************************************


	* ----------------------------------------------------------------------------
	* Combine results for  Figure:

	gen     belief = est_p3_yellow_ui         if intervention_arm == 2 & baby_color == 2
	replace belief = est_p3_yellow_s4         if intervention_arm == 3 & baby_color == 2
	replace belief = est_p3_yellow_s5         if intervention_arm == 4 & baby_color == 2

	replace belief = est_p3_green_ui          if intervention_arm == 2 & baby_color == 1
	replace belief = est_p3_green_s4          if intervention_arm == 3 & baby_color == 1
	replace belief = est_p3_green_s5          if intervention_arm == 4 & baby_color == 1

	replace belief = est_m1_yellow_ui         if intervention_arm == 2 & baby_color == 2
	replace belief = est_m1_yellow_s4         if intervention_arm == 3 & baby_color == 2
	replace belief = est_m1_yellow_s5         if intervention_arm == 4 & baby_color == 2

	replace belief = est_m1_green_ui          if intervention_arm == 2 & baby_color == 1
	replace belief = est_m1_green_s4          if intervention_arm == 3 & baby_color == 1
	replace belief = est_m1_green_s5          if intervention_arm == 4 & baby_color == 1

	* higher confidence interval:
	gen     ci_high = ci_hi_p3_yellow_ui      if intervention_arm == 2 & baby_color == 2
	replace ci_high = ci_hi_p3_yellow_s4      if intervention_arm == 3 & baby_color == 2
	replace ci_high = ci_hi_p3_yellow_s5      if intervention_arm == 4 & baby_color == 2

	replace ci_high = ci_hi_p3_green_ui       if intervention_arm == 2 & baby_color == 1
	replace ci_high = ci_hi_p3_green_s4       if intervention_arm == 3 & baby_color == 1
	replace ci_high = ci_hi_p3_green_s5       if intervention_arm == 4 & baby_color == 1

	replace ci_high = ci_hi_m1_yellow_ui      if intervention_arm == 2 & baby_color == 2
	replace ci_high = ci_hi_m1_yellow_s4      if intervention_arm == 3 & baby_color == 2
	replace ci_high = ci_hi_m1_yellow_s5      if intervention_arm == 4 & baby_color == 2

	replace ci_high = ci_hi_m1_green_ui       if intervention_arm == 2 & baby_color == 1
	replace ci_high = ci_hi_m1_green_s4       if intervention_arm == 3 & baby_color == 1
	replace ci_high = ci_hi_m1_green_s5       if intervention_arm == 4 & baby_color == 1


	* lower confidence interval:
	gen     ci_low = ci_lo_p3_yellow_ui       if intervention_arm == 2 & baby_color == 2
	replace ci_low = ci_lo_p3_yellow_s4       if intervention_arm == 3 & baby_color == 2
	replace ci_low = ci_lo_p3_yellow_s5       if intervention_arm == 4 & baby_color == 2

	replace ci_low = ci_lo_p3_green_ui        if intervention_arm == 2 & baby_color == 1
	replace ci_low = ci_lo_p3_green_s4        if intervention_arm == 3 & baby_color == 1
	replace ci_low = ci_lo_p3_green_s5        if intervention_arm == 4 & baby_color == 1

	replace ci_low = ci_lo_m1_yellow_ui       if intervention_arm == 2 & baby_color == 2
	replace ci_low = ci_lo_m1_yellow_s4       if intervention_arm == 3 & baby_color == 2
	replace ci_low = ci_lo_m1_yellow_s5       if intervention_arm == 4 & baby_color == 2

	replace ci_low = ci_lo_m1_green_ui        if intervention_arm == 2 & baby_color == 1
	replace ci_low = ci_lo_m1_green_s4        if intervention_arm == 3 & baby_color == 1
	replace ci_low = ci_lo_m1_green_s5        if intervention_arm == 4 & baby_color == 1



	* ----------------------------------------------------------------------------
	* Format "delta"- difference between green and yellow for each vaccine and arm:

	* Delta: Vaccine 5: Uninformative
	local delta_v5_ui = -(`b_m1_uni')
	local delta_v5_ui: di %3.2f `delta_v5_ui'
	di   `delta_v5_ui'

	* Delta: Vaccine 5: Signal at 4
	local delta_v5_s4 = -(`b_m1_s4')
	local delta_v5_s4: di %3.2f `delta_v5_s4'
	di   `delta_v5_s4'

	* Delta: Vaccine 5: Signal at 5
	local delta_v5_s5 =- (`b_m1_s5')
	local delta_v5_s5: di %3.2f `delta_v5_s5'
	di   `delta_v5_s5'


	* Delta: Vaccine 4: Uninformative
	local delta_v4_ui = -(`b_p3_uni')
	local delta_v4_ui: di %3.2f `delta_v4_ui'
	di   `delta_v4_ui'

	* Delta: Vaccine 4: Signal at 4
	local delta_v4_s4 = -(`b_p3_s4')
	local delta_v4_s4: di %3.2f `delta_v4_s4'
	di   `delta_v4_s4'

	* Delta: Vaccine 4: Signal at 5
	local delta_v4_s5 = -(`b_p3_s5')
	local delta_v4_s5: di %3.2f `delta_v4_s5'
	di   `delta_v4_s5'






	* ----------------------------------------------------------------------------
	** Generate figure:

	save "${Replicate_SocialSignals_dtaInter}/temp2.dta", replace


	use  "${Replicate_SocialSignals_dtaInter}/temp2.dta", clear

	* Store the estimates to reshape:

	local penta3_ui   = "est_p3_green_ui   ci_lo_p3_green_ui  ci_hi_p3_green_ui est_p3_yellow_ui  ci_lo_p3_yellow_ui  ci_hi_p3_yellow_ui"
	local penta3_s4   = "est_p3_green_s4   ci_lo_p3_green_s4  ci_hi_p3_green_s4 est_p3_yellow_s4  ci_lo_p3_yellow_s4  ci_hi_p3_yellow_s4"
	local penta3_s5   = "est_p3_green_s5   ci_lo_p3_green_s5  ci_hi_p3_green_s5 est_p3_yellow_s5  ci_lo_p3_yellow_s5  ci_hi_p3_yellow_s5"

	local measles1_ui = "est_m1_green_ui   ci_lo_m1_green_ui  ci_hi_m1_green_ui est_m1_yellow_ui  ci_lo_m1_yellow_ui  ci_hi_m1_yellow_ui"
	local measles1_s4 = "est_m1_green_s4   ci_lo_m1_green_s4  ci_hi_m1_green_s4 est_m1_yellow_s4  ci_lo_m1_yellow_s4  ci_hi_m1_yellow_s4"
	local measles1_s5 = "est_m1_green_s5   ci_lo_m1_green_s5  ci_hi_m1_green_s5 est_m1_yellow_s5  ci_lo_m1_yellow_s5  ci_hi_m1_yellow_s5"


	collapse ///
	`penta3_ui'   `penta3_s4'   `penta3_s5'  ///
	`measles1_ui' `measles1_s4' `measles1_s5' ,  by(intervention_arm baby_color)


	reshape long ///
	est_p3_green_  ci_lo_p3_green_  ci_hi_p3_green_  ///
	est_p3_yellow_ ci_lo_p3_yellow_ ci_hi_p3_yellow_  ///
	est_m1_green_  ci_lo_m1_green_  ci_hi_m1_green_  ///
	est_m1_yellow_ ci_lo_m1_yellow_ ci_hi_m1_yellow_, i(intervention_arm baby_color) j(arm) string

	foreach vaccine in p3 m1  {
		foreach color in green yellow {
			rename est_`vaccine'_`color'_    est_`vaccine'_`color'
			rename ci_lo_`vaccine'_`color'_  ci_lo_`vaccine'_`color'
			rename ci_hi_`vaccine'_`color'_  ci_hi_`vaccine'_`color'
		}
	}

	reshape long ///
	est_p3_  ci_lo_p3_  ci_hi_p3_  ///
	est_m1_  ci_lo_m1_  ci_hi_m1_ , i(intervention_arm baby_color arm) j(color) string

	drop if  est_p3_ == . & est_m1_ ==.


	foreach vaccine in p3 m1  {
		rename est_`vaccine'_    est_`vaccine'
		rename ci_lo_`vaccine'_  ci_lo_`vaccine'
		rename ci_hi_`vaccine'_  ci_hi_`vaccine'
	}


	reshape long ///
	est_  ci_lo_  ci_hi_, i(intervention_arm baby_color arm color) j(vaccine) string


	encode   arm,     gen(arm_code)
	encode   color,   gen(color_code)
	encode   vaccine, gen(vaccine_code)
	lab drop vaccine_code

	recode vaccine_code (1 = 3) (3 = 2)

	order  vaccine_code vaccine intervention_arm color_code est_ ci_lo_ ci_hi_
	gsort  vaccine_code intervention_arm color_code est_ ci_lo_ ci_hi_

	egen    group = seq()  , block(2)
	replace group = group+1            if group > 3


	twoway ///
	(bar  est_          group     if baby_color==1, barwidth(0.8) color(green%90)  yscale(r(0 1.1)))                 || ///
	(bar  est_          group     if baby_color==2, barwidth(0.7) color(sandb%100) yscale(r(0 1.1)) ylabel(0(0.1)1)), ///
	ytitle("")  ///
	ylabel(, angle(0))                     ///
	legend(cols(2) order(1 "Child with Green Bracelet" 2 "Child with Yellow Bracelet"))   ///
	xtitle("")  subtitle("Panel B: Truth") name(truth)                          ///
	xlabel(1 "UI" 2 `" "S4"  "Vaccine 4" "' 3 "S5" 5 "UI" 6 `" "S4"  "Vaccine 5" "' 7 "S5", noticks)



	** END OF TRUTH ESTIMATION

	* ******************************************************************************
	* FIRST- ORDER BELIEFS -
	* ******************************************************************************


	use  "${Replicate_SocialSignals_dtaInter}/FirstOrderBeliefs_Constructed.dta", clear


	* ------------------------------------------------------------------------------
	* Beliefs - Measles1
	* ------------------------------------------------------------------------------


	* Generate clinic-level mean Measles 1 immunization rates
	bys   clinic: egen mean_m1 = mean(measles1_u1)    if age_u1>=274 & age_u1<=365


	foreach var in m1  {
		sum mean_`var' if age_u1>=274 & age_u1<=365, detail
		gen `var'_dm           = mean_`var'   - `r(mean)'   if age_u1>=274 & age_u1<=365
	}


	** Comparison of Uninformative, Signal 4th and 5th bracelet
	local   ControlVars = "mother_age_w01 age_u1 edu2 edu3 farm birth2 birth3 birth4 birth5 relate"

	* For 9 - 12 months
	foreach control of local ControlVars  {
		sum `control' if age_u1>=274 & age_u1<=365, detail
		gen    `control'_dm_m1    = `control' - `r(mean)'             if age_u1>=274 & age_u1<=365
	}

	foreach var in strat2 strat3 strat4 strat5 strat6 strat7 strat8 anc2 anc3 anc4 {
	sum `var' if age_u1>=274 & age_u1<=365, detail
	gen   `var'_dm_m1     = `var' - `r(mean)'           if age_u1>=274 & age_u1<=365
	}



	** Green bracelet
	* Code a green and measles 1 indicator:
	gen     green_m1      = 1             if num_color==8 & age_u1>=274 & age_u1<=365
	replace green_m1      = 0             if num_color!=8 & num_color!=. & age_u1>=274 & age_u1<=365

	* Code a green, but NOT measles 1 indicator:
	gen     green_not_m1  = 1             if inlist(num_color,5,6,7) & age_u1>=274 & age_u1<=365
	replace green_not_m1  = 0             if inlist(num_color,1,2,3,4,8,9,10) & age_u1>=274 & age_u1<=365


	** Yellow
	gen     yellow_m1     = 1             if num_color==4 & age_u1>=274 & age_u1<=365
	replace yellow_m1     = 0             if num_color!=4 & num_color!=. & age_u1>=274 & age_u1<=365

	gen     yellow_not_m1 = 1             if inlist(num_color,1,2,3) & age_u1>=274 & age_u1<=365
	replace yellow_not_m1 = 0             if inlist(num_color,4,5,6,7,8,9,10) & age_u1>=274 & age_u1<=365



	* ------------------------------------------------------------------------------
	* Beliefs - Penta 3
	* ------------------------------------------------------------------------------


	bys clinic: egen mean_p3 = mean(penta3_u1)                     if age_u1>=107&age_u1< 274

	foreach var in p3  { 
		sum mean_`var'      if age_u1>=107&age_u1< 274, detail
		gen `var'_dm = mean_`var' - `r(mean)'            if age_u1>=107&age_u1< 274
	}


	**Comparison of Uninformative, Signal 4th and 5th bracelet
	local   ControlVars = "mother_age_w01 age_u1 edu2 edu3 farm birth2 birth3 birth4 birth5 relate"

	* For 3.5 - 9 months
	foreach control of local ControlVars  {
		sum `control'  if age_u1>=107&age_u1< 274, detail
		gen    `control'_dm_p3    = `control' -`r(mean)'             if age_u1>=107&age_u1< 274
	}


	foreach var in strat1 strat2 strat3 strat4 strat5 strat6 strat7 strat8 anc2 anc3 anc4 {
		sum `var' if age_u1>=107&age_u1< 274, detail
		gen `var'_dm_p3    = `var' - `r(mean)'      if age_u1>=107&age_u1< 274
	}


	** Green
	* if 4 or 5 vaccines and a green:
	gen     green_p3     = 1           if inlist(num_color,7,8)       & age_u1>=107&age_u1< 274
	replace green_p3     = 0           if (num_color!=7&num_color!=8) & num_color!=.  & age_u1>=107&age_u1< 274

	* if less than 4 vaccines and a green:
	gen     green_not_p3 = 1           if inlist(num_color,5,6)  & age_u1>=107&age_u1< 274
	replace green_not_p3 = 0           if inlist(num_color,1,2,3,4,7,8,9,10)  & age_u1>=107&age_u1< 274


	** Yellow
	* If 4 or 5 vaccines and a yellow
	gen     yellow_p3    = 1           if inlist(num_color,3,4) & age_u1>=107&age_u1< 274
	replace yellow_p3    = 0           if (num_color!=3&num_color!=4) & num_color!=.& age_u1>=107&age_u1< 274

	* If less than 4 vaccines and a yellow
	gen     yellow_not_p3 = 1          if inlist(num_color,1,2) & age_u1>=107&age_u1< 274
	replace yellow_not_p3 = 0          if inlist(num_color,3,4,5,6,7,8,9,10) & age_u1>=107&age_u1< 274


	********************************************************************************
	* Beliefs - Generate a table with all results combined:


	* Test for Vaccine 5, whether delta Green - Yellow is significant different from
	*    each other across arms

	local ControlVars_P3 = " mother_age_w01_dm_p3 age_u1_dm_p3 edu2_dm_p3 edu3_dm_p3 farm_dm_p3 birth2_dm_p3 birth3_dm_p3 birth4_dm_p3 birth5_dm_p3 relate_dm_p3 p3_dm"
	local StrataVars_P3  = " strat2_dm_p3 strat3_dm_p3 strat4_dm_p3 strat5_dm_p3 strat6_dm_p3 strat7_dm_p3 strat8_dm_p3 "
	local ANCVars_P3     = " anc2_dm_p3 anc3_dm_p3 anc4_dm_p3 "

	local ControlVars_M1 = " mother_age_w01_dm_m1  age_u1_dm_m1 edu2_dm_m1 edu3_dm_m1 farm_dm_m1 birth2_dm_m1 birth3_dm_m1 birth4_dm_m1 birth5_dm_m1 relate_dm_m1 m1_dm"
	local StrataVars_M1  = " strat2_dm_m1 strat3_dm_m1 strat4_dm_m1 strat5_dm_m1 strat6_dm_m1 strat7_dm_m1 strat8_dm_m1 "
	local ANCVars_M1     = " anc2_dm_m1 anc3_dm_m1 anc4_dm_m1  "



	* ------------------------------------------------------------------------------
	* Beliefs - Penta 3
	* ------------------------------------------------------------------------------


	reg    green_p3     treat3 treat4 `ControlVars_P3' `StrataVars_P3' `ANCVars_P3'
	estimates store green_p3_ui_reg
	reg    green_not_p3 treat3 treat4 `ControlVars_P3' `StrataVars_P3' `ANCVars_P3'
	estimates store green_not_p3_ui_reg

	reg    yellow_p3 treat3 treat4 `ControlVars_P3' `StrataVars_P3' `ANCVars_P3'
	estimates store yellow_p3_ui_reg
	reg    yellow_not_p3 treat3 treat4 `ControlVars_P3' `StrataVars_P3' `ANCVars_P3'
	estimates store yellow_not_p3_ui_reg

	* Compare for Signal at 4:
	reg   green_p3 treat3 treat4 `ControlVars_P3' `StrataVars_P3' `ANCVars_P3'
	estimates store green_p3_s4_reg
	reg   green_not_p3 treat3 treat4 `ControlVars_P3' `StrataVars_P3' `ANCVars_P3'
	estimates store green_not_p3_s4_reg

	reg   yellow_p3 treat3 treat4 `ControlVars_P3' `StrataVars_P3' `ANCVars_P3'
	estimates store yellow_p3_s4_reg
	reg   yellow_not_p3 treat3 treat4 `ControlVars_P3' `StrataVars_P3' `ANCVars_P3'
	estimates store yellow_not_p3_s4_reg

	* Compare for Signal at 5:
	reg   green_p3 treat3 treat4 `ControlVars_P3' `StrataVars_P3' `ANCVars_P3'
	estimates store green_p3_s5_reg
	reg   green_not_p3 treat3 treat4 `ControlVars_P3' `StrataVars_P3' `ANCVars_P3'
	estimates store green_not_p3_s5_reg

	reg   yellow_p3 treat3 treat4 `ControlVars_P3' `StrataVars_P3' `ANCVars_P3'
	estimates store yellow_p3_s5_reg
	reg   yellow_not_p3 treat3 treat4 `ControlVars_P3' `StrataVars_P3' `ANCVars_P3'
	estimates store yellow_not_p3_s5_reg


	* Estimate Treatment Effects : Prob(Vaccine 4|Yellow)
	reg      yellow_p3  treat3 treat4 `ControlVars_P3' `StrataVars_P3' `ANCVars_P3', vce(cluster clinic)
	local         t_s4    = _b[treat3]/_se[treat3]
	estadd scalar pval_s4 = 2*ttail(e(df_r),abs(`t_s4'))
	local         t_s5    = _b[treat4]/_se[treat4]
	estadd scalar pval_s5 = 2*ttail(e(df_r),abs(`t_s5'))
	test   treat3 = treat4
	estadd scalar treat3_treat4 = r(p)
	estadd scalar C_mean  = _b[_cons]
	estadd local Obs      = "`e(N)'"
	estadd local controls = "Yes"
	eststo model_yellow_p3

	* Store Confidence Intervals:
	local  yellow_p3_treat3_CI_high = invttail(e(df_r),0.025)*_se[treat3]
	dis   `yellow_p3_treat3_CI_high'

	local  yellow_p3_treat3_CI_low  = invttail(e(df_r),0.025)*_se[treat3]
	dis   `yellow_p3_treat3_CI_low'

	* Store Confidence Intervals:
	local  yellow_p3_treat4_CI_high = invttail(e(df_r),0.025)*_se[treat4]
	dis   `yellow_p3_treat4_CI_high'

	local  yellow_p3_treat4_CI_low  = invttail(e(df_r),0.025)*_se[treat4]
	dis   `yellow_p3_treat4_CI_low'


	* Estimate Treatment Effects : Prob(Vaccine 4|Green)
	reg      green_p3   treat3 treat4 `ControlVars_P3' `StrataVars_P3' `ANCVars_P3', vce(cluster clinic)
	local         t_s4    = _b[treat3]/_se[treat3]
	estadd scalar pval_s4 = 2*ttail(e(df_r),abs(`t_s4'))
	local         t_s5    = _b[treat4]/_se[treat4]
	estadd scalar pval_s5 = 2*ttail(e(df_r),abs(`t_s5'))
	test   treat3 = treat4
	estadd scalar treat3_treat4 = r(p)
	estadd scalar C_mean  = _b[_cons]
	estadd local Obs      = "`e(N)'"
	estadd local controls = "Yes"
	eststo model_green_p3

	* Store Confidence Intervals:
	local  green_p3_treat3_CI_high = invttail(e(df_r),0.025)*_se[treat3]
	dis   `green_p3_treat3_CI_high'

	local  green_p3_treat3_CI_low  = invttail(e(df_r),0.025)*_se[treat3]
	dis   `green_p3_treat3_CI_low'

	* Store Confidence Intervals:
	local  green_p3_treat4_CI_high = invttail(e(df_r),0.025)*_se[treat4]
	dis   `green_p3_treat4_CI_high'

	local  green_p3_treat4_CI_low  = invttail(e(df_r),0.025)*_se[treat4]
	dis   `green_p3_treat4_CI_low'



	* ------------------------------------------------------------------------------
	* Beliefs - Penta 3 - YELLOW
	* ------------------------------------------------------------------------------

	local  model_p3_ui " green_p3_ui_reg  green_not_p3_ui_reg  yellow_p3_ui_reg  yellow_not_p3_ui_reg "
	local  model_p3_s4 " green_p3_s4_reg  green_not_p3_s4_reg  yellow_p3_s4_reg  yellow_not_p3_s4_reg "
	local  model_p3_s5 " green_p3_s5_reg  green_not_p3_s5_reg  yellow_p3_s5_reg  yellow_not_p3_s5_reg "

	suest `model_p3_ui' `model_p3_s4' `model_p3_s5', vce(cluster clinic)

	nlcom ///
	(ui: ([yellow_p3_ui_reg_mean]_cons)/([yellow_p3_ui_reg_mean]_cons+[yellow_not_p3_ui_reg_mean]_cons)) ///
	(s4: ([yellow_p3_s4_reg_mean]treat3+[yellow_p3_s4_reg_mean]_cons)/([yellow_p3_s4_reg_mean]treat3+[yellow_p3_s4_reg_mean]_cons+[yellow_not_p3_s4_reg_mean]treat3+[yellow_not_p3_s4_reg_mean]_cons))   ///
	(s5: ([yellow_p3_s5_reg_mean]treat4+[yellow_p3_s5_reg_mean]_cons)/([yellow_p3_s5_reg_mean]treat4+[yellow_p3_s5_reg_mean]_cons+[yellow_not_p3_s5_reg_mean]treat4+[yellow_not_p3_s5_reg_mean]_cons)), post
	estadd local Obs  = "`r(N)'"
	test   _b[ui] = _b[s4]
	estadd scalar ui_s4 = r(p)
	test   _b[ui] = _b[s5]
	estadd scalar ui_s5 = r(p)
	test   _b[s4] = _b[s5]
	estadd scalar s4_s5 = r(p)
	estadd local controls = "Yes"
	eststo m_beliefs_p3_yellow


	* Store estimates to plot:
	gen    est_p3_yellow_ui   = _b[ui]                            if intervention_arm == 2 & baby_color == 2 & yellow_p3 == 1
	gen    ci_hi_p3_yellow_ui = est_p3_yellow_ui + 1.96*_se[ui]   if intervention_arm == 2 & baby_color == 2 & yellow_p3 == 1
	gen    ci_lo_p3_yellow_ui = est_p3_yellow_ui - 1.96*_se[ui]   if intervention_arm == 2 & baby_color == 2 & yellow_p3 == 1

	gen    est_p3_yellow_s4   = _b[s4]                            if intervention_arm == 3 & baby_color == 2 & yellow_p3 == 1
	gen    ci_hi_p3_yellow_s4 = est_p3_yellow_s4 + 1.96*_se[s4]   if intervention_arm == 3 & baby_color == 2 & yellow_p3 == 1
	gen    ci_lo_p3_yellow_s4 = est_p3_yellow_s4 - 1.96*_se[s4]   if intervention_arm == 3 & baby_color == 2 & yellow_p3 == 1

	gen    est_p3_yellow_s5   = _b[s5]                            if intervention_arm == 4 & baby_color == 2 & yellow_p3 == 1
	gen    ci_hi_p3_yellow_s5 = est_p3_yellow_s5 + 1.96*_se[s5]   if intervention_arm == 4 & baby_color == 2 & yellow_p3 == 1
	gen    ci_lo_p3_yellow_s5 = est_p3_yellow_s5 - 1.96*_se[s5]   if intervention_arm == 4 & baby_color == 2 & yellow_p3 == 1


	* ------------------------------------------------------------------------------
	* Beliefs - Penta 3:  GREEN
	* ------------------------------------------------------------------------------


	local  model_p3_ui " green_p3_ui_reg  green_not_p3_ui_reg  yellow_p3_ui_reg  yellow_not_p3_ui_reg "
	local  model_p3_s4 " green_p3_s4_reg  green_not_p3_s4_reg  yellow_p3_s4_reg  yellow_not_p3_s4_reg "
	local  model_p3_s5 " green_p3_s5_reg  green_not_p3_s5_reg  yellow_p3_s5_reg  yellow_not_p3_s5_reg "

	suest `model_p3_ui' `model_p3_s4' `model_p3_s5', vce(cluster clinic)

	nlcom ///
	(ui: ([green_p3_ui_reg_mean]_cons)/([green_p3_ui_reg_mean]_cons+[green_not_p3_s4_reg_mean]_cons) ) ///
	(s4: ([green_p3_s4_reg_mean]treat3+[green_p3_s4_reg_mean]_cons)/([green_p3_s4_reg_mean]treat3+[green_p3_s4_reg_mean]_cons+[green_not_p3_s4_reg_mean]treat3+[green_not_p3_s4_reg_mean]_cons) )   ///
	(s5: ([green_p3_s5_reg_mean]treat4+[green_p3_s5_reg_mean]_cons)/([green_p3_s5_reg_mean]treat4+[green_p3_s5_reg_mean]_cons+[green_not_p3_s5_reg_mean]treat4+[green_not_p3_s5_reg_mean]_cons) ), post
	estadd local Obs  = "`r(N)'"
	test   _b[ui] = _b[s4]
	estadd scalar ui_s4 = r(p)
	test   _b[ui] = _b[s5]
	estadd scalar ui_s5 = r(p)
	test   _b[s4] = _b[s5]
	estadd scalar s4_s5 = r(p)
	estadd local controls = "Yes"
	eststo m_beliefs_p3_green


	* Store estimate to plot
	gen    est_p3_green_ui   = _b[ui]                            if intervention_arm == 2 & baby_color == 1 & green_p3 == 1
	gen    ci_hi_p3_green_ui = est_p3_green_ui + 1.96*_se[ui]    if intervention_arm == 2 & baby_color == 1 & green_p3 == 1
	gen    ci_lo_p3_green_ui = est_p3_green_ui - 1.96*_se[ui]    if intervention_arm == 2 & baby_color == 1 & green_p3 == 1

	gen    est_p3_green_s4   = _b[s4]                            if intervention_arm == 3 & baby_color == 1 & green_p3 == 1
	gen    ci_hi_p3_green_s4 = est_p3_green_s4 + 1.96*_se[s4]    if intervention_arm == 3 & baby_color == 1 & green_p3 == 1
	gen    ci_lo_p3_green_s4 = est_p3_green_s4 - 1.96*_se[s4]    if intervention_arm == 3 & baby_color == 1 & green_p3 == 1

	gen    est_p3_green_s5   = _b[s5]                            if intervention_arm == 4 & baby_color == 1 & green_p3 == 1
	gen    ci_hi_p3_green_s5 = est_p3_green_s5 + 1.96*_se[s5]    if intervention_arm == 4 & baby_color == 1 & green_p3 == 1
	gen    ci_lo_p3_green_s5 = est_p3_green_s5 - 1.96*_se[s5]    if intervention_arm == 4 & baby_color == 1 & green_p3 == 1


	* ------------------------------------------------------------------------------
	* Beliefs - Penta 3: - Difference between YELLOW - Green
	* ------------------------------------------------------------------------------

	local  model_p3_ui " green_p3_ui_reg  green_not_p3_ui_reg  yellow_p3_ui_reg  yellow_not_p3_ui_reg "
	local  model_p3_s4 " green_p3_s4_reg  green_not_p3_s4_reg  yellow_p3_s4_reg  yellow_not_p3_s4_reg "
	local  model_p3_s5 " green_p3_s5_reg  green_not_p3_s5_reg  yellow_p3_s5_reg  yellow_not_p3_s5_reg "

	suest `model_p3_ui' `model_p3_s4' `model_p3_s5', vce(cluster clinic)

	nlcom ///
	(ui: ([green_p3_ui_reg_mean]_cons)/([green_p3_ui_reg_mean]_cons+[green_not_p3_s4_reg_mean]_cons) - ([yellow_p3_ui_reg_mean]_cons)/([yellow_p3_ui_reg_mean]_cons+[yellow_not_p3_ui_reg_mean]_cons) ) ///
	(s4: ([green_p3_s4_reg_mean]treat3+[green_p3_s4_reg_mean]_cons)/([green_p3_s4_reg_mean]treat3+[green_p3_s4_reg_mean]_cons+[green_not_p3_s4_reg_mean]treat3+[green_not_p3_s4_reg_mean]_cons) - ([yellow_p3_s4_reg_mean]treat3+[yellow_p3_s4_reg_mean]_cons)/([yellow_p3_s4_reg_mean]treat3+[yellow_p3_s4_reg_mean]_cons+[yellow_not_p3_s4_reg_mean]treat3+[yellow_not_p3_s4_reg_mean]_cons))   ///
	(s5: ([green_p3_s5_reg_mean]treat4+[green_p3_s5_reg_mean]_cons)/([green_p3_s5_reg_mean]treat4+[green_p3_s5_reg_mean]_cons+[green_not_p3_s5_reg_mean]treat4+[green_not_p3_s5_reg_mean]_cons) - ([yellow_p3_s5_reg_mean]treat4+[yellow_p3_s5_reg_mean]_cons)/([yellow_p3_s5_reg_mean]treat4+[yellow_p3_s5_reg_mean]_cons+[yellow_not_p3_s5_reg_mean]treat4+[yellow_not_p3_s5_reg_mean]_cons)), post
	estadd local Obs  = "`r(N)'"
	test   _b[ui] = _b[s4]
	estadd scalar ui_s4  = r(p)
	local  p3_pval_ui_s4 = r(p)
	test   _b[ui] = _b[s5]
	estadd scalar ui_s5 = r(p)
	local  p3_pval_ui_s5 = r(p)
	test   _b[s4] = _b[s5]
	estadd scalar s4_s5 = r(p)
	estadd local controls = "Yes"
	eststo m_beliefs_p3_diff


	* Store based on the levels of significance the stars:
	if   `p3_pval_ui_s4' < 0.10 {
		local sig_p3_ui_s4 = "*"
	}
	if   `p3_pval_ui_s4' < 0.05 {
		local sig_p3_ui_s4 = "**"
	}
	if   `p3_pval_ui_s4' < 0.01 {
		local sig_p3_ui_s4 = "***"
	}

	dis  "`sig_p3_ui_s4'"


	if   `p3_pval_ui_s5' < 0.10 {
		local sig_p3_ui_s5 = "*"
	}
	if   `p3_pval_ui_s5' < 0.05 {
		local sig_p3_ui_s5 = "**"
	}
	if   `p3_pval_ui_s5' < 0.01 {
		local sig_p3_ui_s5 = "***"
	}

	dis  "`sig_p3_ui_s5'"


	gen    delta_p3_ui = abs(_b[ui])       if intervention_arm == 2
	gen    delta_p3_s4 = abs(_b[s4])       if intervention_arm == 3
	gen    delta_p3_s5 = abs(_b[s5])       if intervention_arm == 4


	* Pull Signifcance Levels for the figure:

	* Uninformative:
	suest `model_p3_ui' `model_p3_s4' `model_p3_s5', vce(cluster clinic)

	nlcom ///
	(ui: ([yellow_p3_ui_reg_mean]_cons)/([yellow_p3_ui_reg_mean]_cons+[yellow_not_p3_ui_reg_mean]_cons) - ([green_p3_ui_reg_mean]_cons)/([green_p3_ui_reg_mean]_cons+[green_not_p3_s4_reg_mean]_cons) ), post

	matrix b = r(b)
	matrix V = r(V)
	local  std_err = sqrt(V[1,1])
	local  z       = b[1,1]/`std_err'
	local  pvalue_p3_uni = 2*normal(-abs(`z'))

	* Store based on the levels of significance the stars:
	if   `pvalue_p3_uni' < 0.10 {
		local sig_p3_uni = "*"
	}
	if   `pvalue_p3_uni' < 0.05 {
		local sig_p3_uni = "**"
	}
	if   `pvalue_p3_uni' < 0.01 {
		local sig_p3_uni = "***"
	}

	dis  "`sig_p3_uni'"

	local b_p3_uni: di %3.2f _b[ui]
	di   `b_p3_uni'


	* Signal at 4:
	suest `model_p3_ui' `model_p3_s4' `model_p3_s5', vce(cluster clinic)

	nlcom ///
	(s4: ([yellow_p3_s4_reg_mean]treat3+[yellow_p3_s4_reg_mean]_cons)/([yellow_p3_s4_reg_mean]treat3+[yellow_p3_s4_reg_mean]_cons+[yellow_not_p3_s4_reg_mean]treat3+[yellow_not_p3_s4_reg_mean]_cons) - ([green_p3_s4_reg_mean]treat3+[green_p3_s4_reg_mean]_cons)/([green_p3_s4_reg_mean]treat3+[green_p3_s4_reg_mean]_cons+[green_not_p3_s4_reg_mean]treat3+[green_not_p3_s4_reg_mean]_cons) ), post

	matrix b = r(b)
	matrix V = r(V)
	local  std_err = sqrt(V[1,1])
	local  z       = b[1,1]/`std_err'
	local  pvalue_p3_s4 = 2*normal(-abs(`z'))

	* Store based on the levels of significance the stars:
	if   `pvalue_p3_s4' < 0.10 {
		local sig_p3_s4 = "*"
	}
	if   `pvalue_p3_s4' < 0.05 {
		local sig_p3_s4 = "**"
	}
	if   `pvalue_p3_s4' < 0.01 {
		local sig_p3_s4 = "***"
	}

	dis  "`sig_p3_s4'"

	local b_p3_s4: di %3.2f _b[s4]
	di   `b_p3_s4'



	* Signal at 5:
	suest `model_p3_ui' `model_p3_s4' `model_p3_s5', vce(cluster clinic)

	nlcom ///
	(s5: ([yellow_p3_s5_reg_mean]treat4+[yellow_p3_s5_reg_mean]_cons)/([yellow_p3_s5_reg_mean]treat4+[yellow_p3_s5_reg_mean]_cons+[yellow_not_p3_s5_reg_mean]treat4+[yellow_not_p3_s5_reg_mean]_cons) - ([green_p3_s5_reg_mean]treat4+[green_p3_s5_reg_mean]_cons)/([green_p3_s5_reg_mean]treat4+[green_p3_s5_reg_mean]_cons+[green_not_p3_s5_reg_mean]treat4+[green_not_p3_s5_reg_mean]_cons) ), post

	matrix b = r(b)
	matrix V = r(V)
	local  std_err = sqrt(V[1,1])
	local  z       = b[1,1]/`std_err'
	local  pvalue_p3_s5 = 2*normal(-abs(`z'))

	* Store based on the levels of significance the stars:
	if   `pvalue_p3_s5' < 0.10 {
		local sig_p3_s5 = "*"
	}
	if   `pvalue_p3_s5' < 0.05 {
		local sig_p3_s5 = "**"
	}
	if   `pvalue_p3_s5' < 0.01 {
		local sig_p3_s5 = "***"
	}

	dis  "`sig_p3_s5'"

	local b_p3_s5: di %3.2f _b[s5]
	di   `b_p3_s5'



	* ------------------------------------------------------------------------------
	* Beliefs - Measles 1
	* ------------------------------------------------------------------------------


	** for Uninformative:
	reg    green_m1       treat3 treat4 `ControlVars_M1' `StrataVars_M1' `ANCVars_M1'
	estimates store green_m1_ui_reg
	reg    green_not_m1   treat3 treat4 `ControlVars_M1' `StrataVars_M1' `ANCVars_M1'
	estimates store green_not_m1_ui_reg

	reg    yellow_m1    treat3 treat4 `ControlVars_M1' `StrataVars_M1' `ANCVars_M1'
	estimates store  yellow_m1_ui_reg
	reg    yellow_not_m1 treat3 treat4 `ControlVars_M1' `StrataVars_M1' `ANCVars_M1'
	estimates store  yellow_not_m1_ui_reg

	** for Signal at 4:
	reg    green_m1    treat3 treat4 `ControlVars_M1' `StrataVars_M1' `ANCVars_M1'
	estimates store  green_m1_s4_reg
	reg    green_not_m1 treat3 treat4 `ControlVars_M1' `StrataVars_M1' `ANCVars_M1'
	estimates store  green_not_m1_s4_reg

	reg    yellow_m1    treat3 treat4 `ControlVars_M1' `StrataVars_M1' `ANCVars_M1'
	estimates store  yellow_m1_s4_reg
	reg    yellow_not_m1 treat3 treat4 `ControlVars_M1' `StrataVars_M1' `ANCVars_M1'
	estimates store  yellow_not_m1_s4_reg

	** for Signal at 5:
	reg    green_m1    treat3 treat4 `ControlVars_M1' `StrataVars_M1' `ANCVars_M1'
	estimates store  green_m1_s5_reg
	reg    green_not_m1 treat3 treat4 `ControlVars_M1' `StrataVars_M1' `ANCVars_M1'
	estimates store  green_not_m1_s5_reg

	reg    yellow_m1    treat3 treat4 `ControlVars_M1' `StrataVars_M1' `ANCVars_M1'
	estimates store  yellow_m1_s5_reg
	reg    yellow_not_m1 treat3 treat4 `ControlVars_M1' `StrataVars_M1' `ANCVars_M1'
	estimates store  yellow_not_m1_s5_reg



	* Estimate Treatment Effects : Prob(Vaccine 4|Yellow)
	reg      yellow_m1  treat3 treat4 `ControlVars_M1' `StrataVars_M1' `ANCVars_M1', vce(cluster clinic)
	local         t_s4    = _b[treat3]/_se[treat3]
	estadd scalar pval_s4 = 2*ttail(e(df_r),abs(`t_s4'))
	local         t_s5    = _b[treat4]/_se[treat4]
	estadd scalar pval_s5 = 2*ttail(e(df_r),abs(`t_s5'))
	test   treat3 = treat4
	estadd scalar treat3_treat4 = r(p)
	estadd scalar C_mean  = _b[_cons]
	estadd local Obs      = "`e(N)'"
	estadd local controls = "Yes"
	eststo model_yellow_m1


	* Store Confidence Intervals:
	local  yellow_m1_treat3_CI_high = invttail(e(df_r),0.025)*_se[treat3]
	dis   `yellow_m1_treat3_CI_high'

	local  yellow_m1_treat3_CI_low  = invttail(e(df_r),0.025)*_se[treat3]
	dis   `yellow_m1_treat3_CI_low'

	* Store Confidence Intervals:
	local  yellow_m1_treat4_CI_high = invttail(e(df_r),0.025)*_se[treat4]
	dis   `yellow_m1_treat4_CI_high'

	local  yellow_m1_treat4_CI_low  = invttail(e(df_r),0.025)*_se[treat4]
	dis   `yellow_m1_treat4_CI_low'



	* Estimate Treatment Effects : Prob(Vaccine 4|Green)
	reg      green_m1   treat3 treat4 `ControlVars_M1' `StrataVars_M1' `ANCVars_M1', vce(cluster clinic)
	local         t_s4    = _b[treat3]/_se[treat3]
	estadd scalar pval_s4 = 2*ttail(e(df_r),abs(`t_s4'))
	local         t_s5    = _b[treat4]/_se[treat4]
	estadd scalar pval_s5 = 2*ttail(e(df_r),abs(`t_s5'))
	test   treat3 = treat4
	estadd scalar treat3_treat4 = r(p)
	estadd scalar C_mean  = _b[_cons]
	estadd local Obs      = "`e(N)'"
	estadd local controls = "Yes"
	eststo model_green_m1

	* Store Confidence Intervals:
	local  green_m1_treat3_CI_high = invttail(e(df_r),0.025)*_se[treat3]
	dis   `green_m1_treat3_CI_high'

	local  green_m1_treat3_CI_low  = invttail(e(df_r),0.025)*_se[treat3]
	dis   `green_m1_treat3_CI_low'

	* Store Confidence Intervals:
	local  green_m1_treat4_CI_high = invttail(e(df_r),0.025)*_se[treat4]
	dis   `green_m1_treat4_CI_high'

	local  green_m1_treat4_CI_low  = invttail(e(df_r),0.025)*_se[treat4]
	dis   `green_m1_treat4_CI_low'





	* ------------------------------------------------------------------------------
	* Measles 1 - YELLOW
	* ------------------------------------------------------------------------------

	local  model_m1_ui " green_m1_ui_reg green_not_m1_ui_reg yellow_m1_ui_reg yellow_not_m1_ui_reg "
	local  model_m1_s4 " green_m1_s4_reg green_not_m1_s4_reg yellow_m1_s4_reg yellow_not_m1_s4_reg "
	local  model_m1_s5 " green_m1_s5_reg green_not_m1_s5_reg yellow_m1_s5_reg yellow_not_m1_s5_reg "

	suest `model_m1_ui' `model_m1_s4' `model_m1_s5', vce(cluster clinic)

	nlcom ///
	(ui: ([yellow_m1_ui_reg_mean]_cons)/([yellow_m1_ui_reg_mean]_cons+[yellow_not_m1_ui_reg_mean]_cons)) ///
	(s4: ([yellow_m1_s4_reg_mean]treat3+[yellow_m1_s4_reg_mean]_cons)/([yellow_m1_s4_reg_mean]treat3+[yellow_m1_s4_reg_mean]_cons+[yellow_not_m1_s4_reg_mean]treat3+[yellow_not_m1_s4_reg_mean]_cons))   ///
	(s5: ([yellow_m1_s5_reg_mean]treat4+[yellow_m1_s5_reg_mean]_cons)/([yellow_m1_s5_reg_mean]treat4+[yellow_m1_s5_reg_mean]_cons+[yellow_not_m1_s5_reg_mean]treat4+[yellow_not_m1_s5_reg_mean]_cons)), post
	estadd local Obs  = "`r(N)'"
	test   _b[ui] = _b[s4]
	estadd scalar ui_s4 = r(p)
	test   _b[ui] = _b[s5]
	estadd scalar ui_s5 = r(p)
	test   _b[s4] = _b[s5]
	estadd scalar s4_s5 = r(p)
	estadd local controls = "Yes"
	eststo m_beliefs_m1_yellow


	* Store estimates to plot:
	gen    est_m1_yellow_ui   = _b[ui]                            if intervention_arm == 2 & baby_color == 2 & yellow_m1 == 1
	gen    ci_hi_m1_yellow_ui = est_m1_yellow_ui + 1.96*_se[ui]   if intervention_arm == 2 & baby_color == 2 & yellow_m1 == 1
	gen    ci_lo_m1_yellow_ui = est_m1_yellow_ui - 1.96*_se[ui]   if intervention_arm == 2 & baby_color == 2 & yellow_m1 == 1

	gen    est_m1_yellow_s4   = _b[s4]                            if intervention_arm == 3 & baby_color == 2 & yellow_m1 == 1
	gen    ci_hi_m1_yellow_s4 = est_m1_yellow_s4 + 1.96*_se[s4]   if intervention_arm == 3 & baby_color == 2 & yellow_m1 == 1
	gen    ci_lo_m1_yellow_s4 = est_m1_yellow_s4 - 1.96*_se[s4]   if intervention_arm == 3 & baby_color == 2 & yellow_m1 == 1

	gen    est_m1_yellow_s5   = _b[s5]                            if intervention_arm == 4 & baby_color == 2 & yellow_m1 == 1
	gen    ci_hi_m1_yellow_s5 = est_m1_yellow_s5 + 1.96*_se[s5]   if intervention_arm == 4 & baby_color == 2 & yellow_m1 == 1
	gen    ci_lo_m1_yellow_s5 = est_m1_yellow_s5 - 1.96*_se[s5]   if intervention_arm == 4 & baby_color == 2 & yellow_m1 == 1



	* ------------------------------------------------------------------------------
	* Beliefs - Measles 1 - GREEN
	* ------------------------------------------------------------------------------

	local  model_m1_ui " green_m1_ui_reg green_not_m1_ui_reg yellow_m1_ui_reg yellow_not_m1_ui_reg "
	local  model_m1_s4 " green_m1_s4_reg green_not_m1_s4_reg yellow_m1_s4_reg yellow_not_m1_s4_reg "
	local  model_m1_s5 " green_m1_s5_reg green_not_m1_s5_reg yellow_m1_s5_reg yellow_not_m1_s5_reg "

	suest `model_m1_ui' `model_m1_s4' `model_m1_s5', vce(cluster clinic)

	nlcom ///
	(ui: ([green_m1_ui_reg_mean]_cons)/([green_m1_ui_reg_mean]_cons+[green_not_m1_s4_reg_mean]_cons)) ///
	(s4: ([green_m1_s4_reg_mean]treat3+[green_m1_s4_reg_mean]_cons)/([green_m1_s4_reg_mean]treat3+[green_m1_s4_reg_mean]_cons+[green_not_m1_s4_reg_mean]treat3+[green_not_m1_s4_reg_mean]_cons))   ///
	(s5: ([green_m1_s5_reg_mean]treat4+[green_m1_s5_reg_mean]_cons)/([green_m1_s5_reg_mean]treat4+[green_m1_s5_reg_mean]_cons+[green_not_m1_s5_reg_mean]treat4+[green_not_m1_s5_reg_mean]_cons)), post
	estadd local Obs  = "`r(N)'"
	test   _b[ui] = _b[s4]
	estadd scalar ui_s4 = r(p)
	test   _b[ui] = _b[s5]
	estadd scalar ui_s5 = r(p)
	test   _b[s4] = _b[s5]
	estadd scalar s4_s5 = r(p)
	estadd local controls = "Yes"
	eststo m_beliefs_m1_green


	* Store estimate to plot
	gen    est_m1_green_ui   = _b[ui]                            if intervention_arm == 2 & baby_color == 1 & green_m1 == 1
	gen    ci_hi_m1_green_ui = est_m1_green_ui + 1.96*_se[ui]    if intervention_arm == 2 & baby_color == 1 & green_m1 == 1
	gen    ci_lo_m1_green_ui = est_m1_green_ui - 1.96*_se[ui]    if intervention_arm == 2 & baby_color == 1 & green_m1 == 1

	gen    est_m1_green_s4   = _b[s4]                            if intervention_arm == 3 & baby_color == 1 & green_m1 == 1
	gen    ci_hi_m1_green_s4 = est_m1_green_s4 + 1.96*_se[s4]    if intervention_arm == 3 & baby_color == 1 & green_m1 == 1
	gen    ci_lo_m1_green_s4 = est_m1_green_s4 - 1.96*_se[s4]    if intervention_arm == 3 & baby_color == 1 & green_m1 == 1

	gen    est_m1_green_s5   = _b[s5]                            if intervention_arm == 4 & baby_color == 1 & green_m1 == 1
	gen    ci_hi_m1_green_s5 = est_m1_green_s5 + 1.96*_se[s5]    if intervention_arm == 4 & baby_color == 1 & green_m1 == 1
	gen    ci_lo_m1_green_s5 = est_m1_green_s5 - 1.96*_se[s5]    if intervention_arm == 4 & baby_color == 1 & green_m1 == 1




	* ----------------------------------------------------------------------------
	* Beliefs -  Measles 1  - Difference Between YELLOW - Green
	* ----------------------------------------------------------------------------


	local  model_m1_ui " green_m1_ui_reg green_not_m1_ui_reg yellow_m1_ui_reg yellow_not_m1_ui_reg "
	local  model_m1_s4 " green_m1_s4_reg green_not_m1_s4_reg yellow_m1_s4_reg yellow_not_m1_s4_reg "
	local  model_m1_s5 " green_m1_s5_reg green_not_m1_s5_reg yellow_m1_s5_reg yellow_not_m1_s5_reg "

	suest `model_m1_ui' `model_m1_s4' `model_m1_s5', vce(cluster clinic)

	nlcom ///
	(ui: ([green_m1_ui_reg_mean]_cons)/([green_m1_ui_reg_mean]_cons+[green_not_m1_s4_reg_mean]_cons) - ([yellow_m1_ui_reg_mean]_cons)/([yellow_m1_ui_reg_mean]_cons+[yellow_not_m1_ui_reg_mean]_cons) ) ///
	(s4: ([green_m1_s4_reg_mean]treat3+[green_m1_s4_reg_mean]_cons)/([green_m1_s4_reg_mean]treat3+[green_m1_s4_reg_mean]_cons+[green_not_m1_s4_reg_mean]treat3+[green_not_m1_s4_reg_mean]_cons) - ([yellow_m1_s4_reg_mean]treat3+[yellow_m1_s4_reg_mean]_cons)/([yellow_m1_s4_reg_mean]treat3+[yellow_m1_s4_reg_mean]_cons+[yellow_not_m1_s4_reg_mean]treat3+[yellow_not_m1_s4_reg_mean]_cons))   ///
	(s5: ([green_m1_s5_reg_mean]treat4+[green_m1_s5_reg_mean]_cons)/([green_m1_s5_reg_mean]treat4+[green_m1_s5_reg_mean]_cons+[green_not_m1_s5_reg_mean]treat4+[green_not_m1_s5_reg_mean]_cons) - ([yellow_m1_s5_reg_mean]treat4+[yellow_m1_s5_reg_mean]_cons)/([yellow_m1_s5_reg_mean]treat4+[yellow_m1_s5_reg_mean]_cons+[yellow_not_m1_s5_reg_mean]treat4+[yellow_not_m1_s5_reg_mean]_cons)), post
	estadd local Obs  = "`r(N)'"
	test   _b[ui] = _b[s4]
	estadd scalar ui_s4 = r(p)
	local  m1_pval_ui_s4 = r(p)
	test   _b[ui] = _b[s5]
	estadd scalar ui_s5 = r(p)
	local  m1_pval_ui_s5 = r(p)
	test   _b[s4] = _b[s5]
	estadd scalar s4_s5 = r(p)
	estadd local controls = "Yes"
	eststo m_beliefs_m1_diff


	* Store based on the levels of significance the stars:
	if   `m1_pval_ui_s4' < 0.10 {
		local sig_m1_ui_s4 = "*"
	}
	if   `m1_pval_ui_s4' < 0.05 {
		local sig_m1_ui_s4 = "**"
	}
	if   `m1_pval_ui_s4' < 0.01 {
		local sig_m1_ui_s4 = "***"
	}

	dis  "`sig_m1_ui_s4'"


	if   `m1_pval_ui_s5' < 0.10 {
		local sig_m1_ui_s5 = "*"
	}
	if   `m1_pval_ui_s5' < 0.05 {
		local sig_m1_ui_s5 = "**"
	}
	if   `m1_pval_ui_s5' < 0.01 {
		local sig_m1_ui_s5 = "***"
	}

	dis  "`sig_m1_ui_s5'"



	* Store delta's for the figure:
	gen    delta_m1_ui = abs(_b[ui])       if intervention_arm == 2
	gen    delta_m1_s4 = abs(_b[s4])       if intervention_arm == 3
	gen    delta_m1_s5 = abs(_b[s5])       if intervention_arm == 4


	* Pull Signifcance Levels for the figure:

	* Uninformative:
	suest `model_m1_ui' `model_m1_s4' `model_m1_s5', vce(cluster clinic)

	nlcom ///
	(ui: ([yellow_m1_ui_reg_mean]_cons)/([yellow_m1_ui_reg_mean]_cons+[yellow_not_m1_ui_reg_mean]_cons) - ([green_m1_ui_reg_mean]_cons)/([green_m1_ui_reg_mean]_cons+[green_not_m1_s4_reg_mean]_cons) ), post

	matrix b = r(b)
	matrix V = r(V)
	local  std_err = sqrt(V[1,1])
	local  z       = b[1,1]/`std_err'
	local  pvalue_m1_uni = 2*normal(-abs(`z'))

	* Store based on the levels of significance the stars:
	if   `pvalue_m1_uni' < 0.10 {
		local sig_m1_uni = "*"
	}
	if   `pvalue_m1_uni' < 0.05 {
		local sig_m1_uni = "**"
	}
	if   `pvalue_m1_uni' < 0.01 {
		local sig_m1_uni = "***"
	}

	dis  "`sig_m1_uni'"

	local b_m1_uni: di %3.2f _b[ui]
	di   `b_m1_uni'


	* Signal at 4:
	suest `model_m1_ui' `model_m1_s4' `model_m1_s5', vce(cluster clinic)

	nlcom ///
	(s4: ([yellow_m1_s4_reg_mean]treat3+[yellow_m1_s4_reg_mean]_cons)/([yellow_m1_s4_reg_mean]treat3+[yellow_m1_s4_reg_mean]_cons+[yellow_not_m1_s4_reg_mean]treat3+[yellow_not_m1_s4_reg_mean]_cons) - ([green_m1_s4_reg_mean]treat3+[green_m1_s4_reg_mean]_cons)/([green_m1_s4_reg_mean]treat3+[green_m1_s4_reg_mean]_cons+[green_not_m1_s4_reg_mean]treat3+[green_not_m1_s4_reg_mean]_cons) ), post

	matrix b = r(b)
	matrix V = r(V)
	local  std_err = sqrt(V[1,1])
	local  z       = b[1,1]/`std_err'
	local  pvalue_m1_s4 = 2*normal(-abs(`z'))

	* Store based on the levels of significance the stars:
	if   `pvalue_m1_s4' < 0.10 {
		local sig_m1_s4 = "*"
	}
	if   `pvalue_m1_s4' < 0.05 {
		local sig_m1_s4 = "**"
	}
	if   `pvalue_m1_s4' < 0.01 {
		local sig_m1_s4 = "***"
	}

	dis  "`sig_m1_s4'"

	local b_m1_s4: di %3.2f _b[s4]
	di   `b_m1_s4'



	* Signal at 5:
	suest `model_m1_ui' `model_m1_s4' `model_m1_s5', vce(cluster clinic)

	nlcom ///
	(s5: ([yellow_m1_s5_reg_mean]treat4+[yellow_m1_s5_reg_mean]_cons)/([yellow_m1_s5_reg_mean]treat4+[yellow_m1_s5_reg_mean]_cons+[yellow_not_m1_s5_reg_mean]treat4+[yellow_not_m1_s5_reg_mean]_cons) - ([green_m1_s5_reg_mean]treat4+[green_m1_s5_reg_mean]_cons)/([green_m1_s5_reg_mean]treat4+[green_m1_s5_reg_mean]_cons+[green_not_m1_s5_reg_mean]treat4+[green_not_m1_s5_reg_mean]_cons) ), post

	matrix b = r(b)
	matrix V = r(V)
	local  std_err = sqrt(V[1,1])
	local  z       = b[1,1]/`std_err'
	local  pvalue_m1_s5 = 2*normal(-abs(`z'))

	* Store based on the levels of significance the stars:
	if   `pvalue_m1_s5' < 0.10 {
		local sig_m1_s5 = "*"
	}
	if   `pvalue_m1_s5' < 0.05 {
		local sig_m1_s5 = "**"
	}
	if   `pvalue_m1_s5' < 0.01 {
		local sig_m1_s5 = "***"
	}

	dis  "`sig_m1_s5'"

	local b_m1_s5: di %3.2f _b[s5]
	di   `b_m1_s5'




	* ******************************************************************************
	* Beliefs - Generate Figure and Tables:
	* ******************************************************************************


	* ----------------------------------------------------------------------------
	* Combine results for  Figure:

	gen     belief = est_p3_yellow_ui         if intervention_arm == 2 & baby_color == 2
	replace belief = est_p3_yellow_s4         if intervention_arm == 3 & baby_color == 2
	replace belief = est_p3_yellow_s5         if intervention_arm == 4 & baby_color == 2

	replace belief = est_p3_green_ui          if intervention_arm == 2 & baby_color == 1
	replace belief = est_p3_green_s4          if intervention_arm == 3 & baby_color == 1
	replace belief = est_p3_green_s5          if intervention_arm == 4 & baby_color == 1

	replace belief = est_m1_yellow_ui         if intervention_arm == 2 & baby_color == 2
	replace belief = est_m1_yellow_s4         if intervention_arm == 3 & baby_color == 2
	replace belief = est_m1_yellow_s5         if intervention_arm == 4 & baby_color == 2

	replace belief = est_m1_green_ui          if intervention_arm == 2 & baby_color == 1
	replace belief = est_m1_green_s4          if intervention_arm == 3 & baby_color == 1
	replace belief = est_m1_green_s5          if intervention_arm == 4 & baby_color == 1

	* higher confidence interval:
	gen     ci_high = ci_hi_p3_yellow_ui      if intervention_arm == 2 & baby_color == 2
	replace ci_high = ci_hi_p3_yellow_s4      if intervention_arm == 3 & baby_color == 2
	replace ci_high = ci_hi_p3_yellow_s5      if intervention_arm == 4 & baby_color == 2

	replace ci_high = ci_hi_p3_green_ui       if intervention_arm == 2 & baby_color == 1
	replace ci_high = ci_hi_p3_green_s4       if intervention_arm == 3 & baby_color == 1
	replace ci_high = ci_hi_p3_green_s5       if intervention_arm == 4 & baby_color == 1

	replace ci_high = ci_hi_m1_yellow_ui      if intervention_arm == 2 & baby_color == 2
	replace ci_high = ci_hi_m1_yellow_s4      if intervention_arm == 3 & baby_color == 2
	replace ci_high = ci_hi_m1_yellow_s5      if intervention_arm == 4 & baby_color == 2

	replace ci_high = ci_hi_m1_green_ui       if intervention_arm == 2 & baby_color == 1
	replace ci_high = ci_hi_m1_green_s4       if intervention_arm == 3 & baby_color == 1
	replace ci_high = ci_hi_m1_green_s5       if intervention_arm == 4 & baby_color == 1


	* lower confidence interval:
	gen     ci_low = ci_lo_p3_yellow_ui       if intervention_arm == 2 & baby_color == 2
	replace ci_low = ci_lo_p3_yellow_s4       if intervention_arm == 3 & baby_color == 2
	replace ci_low = ci_lo_p3_yellow_s5       if intervention_arm == 4 & baby_color == 2

	replace ci_low = ci_lo_p3_green_ui        if intervention_arm == 2 & baby_color == 1
	replace ci_low = ci_lo_p3_green_s4        if intervention_arm == 3 & baby_color == 1
	replace ci_low = ci_lo_p3_green_s5        if intervention_arm == 4 & baby_color == 1

	replace ci_low = ci_lo_m1_yellow_ui       if intervention_arm == 2 & baby_color == 2
	replace ci_low = ci_lo_m1_yellow_s4       if intervention_arm == 3 & baby_color == 2
	replace ci_low = ci_lo_m1_yellow_s5       if intervention_arm == 4 & baby_color == 2

	replace ci_low = ci_lo_m1_green_ui        if intervention_arm == 2 & baby_color == 1
	replace ci_low = ci_lo_m1_green_s4        if intervention_arm == 3 & baby_color == 1
	replace ci_low = ci_lo_m1_green_s5        if intervention_arm == 4 & baby_color == 1



	* ----------------------------------------------------------------------------
	* Format "delta"- difference between green and yellow for each vaccine and arm:

	* Delta: Vaccine 5: Uninformative
	local delta_v5_ui = -(`b_m1_uni')
	local delta_v5_ui: di %3.2f `delta_v5_ui'
	di   `delta_v5_ui'

	* Delta: Vaccine 5: Signal at 4
	local delta_v5_s4 = -(`b_m1_s4')+(`b_m1_uni')
	local delta_v5_s4: di %3.2f `delta_v5_s4'
	di   `delta_v5_s4'

	* Delta: Vaccine 5: Signal at 5
	local delta_v5_s5 =- (`b_m1_s5')+(`b_m1_uni')
	local delta_v5_s5: di %3.2f `delta_v5_s5'
	di   `delta_v5_s5'


	* Delta: Vaccine 4: Uninformative
	local delta_v4_ui = -(`b_p3_uni')
	local delta_v4_ui: di %3.2f `delta_v4_ui'
	di   `delta_v4_ui'

	* Delta: Vaccine 4: Signal at 4
	local delta_v4_s4 = -(`b_p3_s4')+(`b_p3_uni')
	local delta_v4_s4: di %3.2f `delta_v4_s4'
	di   `delta_v4_s4'

	* Delta: Vaccine 4: Signal at 5
	local delta_v4_s5 = -(`b_p3_s5')+(`b_p3_uni')
	local delta_v4_s5: di %3.2f `delta_v4_s5'
	di   `delta_v4_s5'




	* ----------------------------------------------------------------------------
	* Beliefs - Generate figure:

	save "${Replicate_SocialSignals_dtaInter}/temp2.dta", replace


	use  "${Replicate_SocialSignals_dtaInter}/temp2.dta", clear

	* Store the estimates to reshape:
	local penta3_ui   = "est_p3_green_ui   ci_lo_p3_green_ui  ci_hi_p3_green_ui est_p3_yellow_ui  ci_lo_p3_yellow_ui  ci_hi_p3_yellow_ui"
	local penta3_s4   = "est_p3_green_s4   ci_lo_p3_green_s4  ci_hi_p3_green_s4 est_p3_yellow_s4  ci_lo_p3_yellow_s4  ci_hi_p3_yellow_s4"
	local penta3_s5   = "est_p3_green_s5   ci_lo_p3_green_s5  ci_hi_p3_green_s5 est_p3_yellow_s5  ci_lo_p3_yellow_s5  ci_hi_p3_yellow_s5"

	local measles1_ui = "est_m1_green_ui   ci_lo_m1_green_ui  ci_hi_m1_green_ui est_m1_yellow_ui  ci_lo_m1_yellow_ui  ci_hi_m1_yellow_ui"
	local measles1_s4 = "est_m1_green_s4   ci_lo_m1_green_s4  ci_hi_m1_green_s4 est_m1_yellow_s4  ci_lo_m1_yellow_s4  ci_hi_m1_yellow_s4"
	local measles1_s5 = "est_m1_green_s5   ci_lo_m1_green_s5  ci_hi_m1_green_s5 est_m1_yellow_s5  ci_lo_m1_yellow_s5  ci_hi_m1_yellow_s5"


	collapse ///
	`penta3_ui'   `penta3_s4'   `penta3_s5'  ///
	`measles1_ui' `measles1_s4' `measles1_s5' ,  by(intervention_arm baby_color)


	reshape long ///
	est_p3_green_  ci_lo_p3_green_  ci_hi_p3_green_  ///
	est_p3_yellow_ ci_lo_p3_yellow_ ci_hi_p3_yellow_  ///
	est_m1_green_  ci_lo_m1_green_  ci_hi_m1_green_  ///
	est_m1_yellow_ ci_lo_m1_yellow_ ci_hi_m1_yellow_, i(intervention_arm baby_color) j(arm) string

	foreach vaccine in p3 m1  {
		foreach color in green yellow {
			rename   est_`vaccine'_`color'_    est_`vaccine'_`color'
			rename ci_lo_`vaccine'_`color'_  ci_lo_`vaccine'_`color'
			rename ci_hi_`vaccine'_`color'_  ci_hi_`vaccine'_`color'
		}
	}

	reshape long ///
	est_p3_  ci_lo_p3_  ci_hi_p3_  ///
	est_m1_  ci_lo_m1_  ci_hi_m1_ , i(intervention_arm baby_color arm) j(color) string

	drop if   est_p3_ == . & est_m1_ ==.


	foreach vaccine in p3 m1  {
		rename est_`vaccine'_    est_`vaccine'
		rename ci_lo_`vaccine'_  ci_lo_`vaccine'
		rename ci_hi_`vaccine'_  ci_hi_`vaccine'
	}


	reshape long ///
	est_  ci_lo_  ci_hi_, i(intervention_arm baby_color arm color) j(vaccine) string


	encode   arm,     gen(arm_code)
	encode   color,   gen(color_code)
	encode   vaccine, gen(vaccine_code)
	lab drop vaccine_code

	recode vaccine_code (1 = 3) (3 = 2)

	order  vaccine_code vaccine intervention_arm color_code est_ ci_lo_ ci_hi_
	gsort  vaccine_code intervention_arm color_code est_ ci_lo_ ci_hi_

	egen    group = seq()  , block(2)
	replace group = group+1            if group > 3



	twoway ///
	(bar  est_          group     if baby_color==1, barwidth(0.8) color(green%90)  yscale(r(0 1.1)))                 || ///
	(bar  est_          group     if baby_color==2, barwidth(0.7) color(sandb%100) yscale(r(0 1.1)) ylabel(0(0.1)1)) || ///
	(rcap ci_hi_ ci_lo_ group     if inlist(intervention_arm,3,4),  lwidth(medthicks) lcolor(gs6)), ///
	text(0.96  2 "{&Delta}=`delta_v4_s4'`sig_p3_ui_s4'" , size(medsmall) color(gs0)) ///
	text(1.06  3 "{&Delta}=`delta_v4_s5'`sig_p3_ui_s5'" , size(medsmall) color(gs0)) ///
	text(0.82  6 "{&Delta}=`delta_v5_s4'`sig_m1_ui_s4'" , size(medsmall) color(gs0)) ///
	text(0.92  7 "{&Delta}=`delta_v5_s5'`sig_m1_ui_s5'" , size(medsmall) color(gs0)) ///
	ytitle("Pr(# Vaccine {&ge} a|Color)")  ///
	ylabel(, angle(0))                     ///
	legend(cols(2) order(1 "Child with Green Bracelet" 2 "Child with Yellow Bracelet"))   ///
	xtitle("")  subtitle("Panel A: Parents’ Inferences") name(perceived)                          ///
	xlabel(1 "UI" 2 `" "S4"  "Vaccine 4" "' 3 "S5" 5 "UI" 6 `" "S4"  "Vaccine 5" "' 7 "S5", noticks)


	grc1leg ///
	perceived truth, legendfrom(perceived)  subtitle("")



	replace ci_hi_ = est_ + `yellow_m1_treat3_CI_high'      if  baby_color == 2 & intervention_arm == 3
	replace ci_hi_ = est_ + `yellow_m1_treat4_CI_high'      if  baby_color == 2 & intervention_arm == 4
	replace ci_hi_ = est_ + `green_m1_treat3_CI_high'       if  baby_color == 1 & intervention_arm == 3
	replace ci_hi_ = est_ + `green_m1_treat4_CI_high'       if  baby_color == 1 & intervention_arm == 4

	replace ci_lo_ = est_ - `yellow_m1_treat3_CI_low'       if  baby_color == 2 & intervention_arm == 3
	replace ci_lo_ = est_ - `yellow_m1_treat4_CI_low'       if  baby_color == 2 & intervention_arm == 4
	replace ci_lo_ = est_ - `green_m1_treat3_CI_low'        if  baby_color == 1 & intervention_arm == 3
	replace ci_lo_ = est_ - `green_m1_treat4_CI_low'        if  baby_color == 1 & intervention_arm == 4



	twoway ///
	(bar  est_          group     if baby_color==1, barwidth(0.8) color(green%90)  yscale(r(0 1.1)))                 || ///
	(bar  est_          group     if baby_color==2, barwidth(0.7) color(sandb%100) yscale(r(0 1.1)) ylabel(0(0.1)1)) || ///
	(rcap ci_hi_ ci_lo_ group     if inlist(intervention_arm,3,4),  lwidth(medthicks) lcolor(gs6)), ///
	text(1.00  2 "{&Delta}=`delta_v4_s4'`sig_p3_ui_s4'" , size(medsmall) color(gs0)) ///
	text(1.06  3 "{&Delta}=`delta_v4_s5'`sig_p3_ui_s5'" , size(medsmall) color(gs0)) ///
	text(0.80  6 "{&Delta}=`delta_v5_s4'`sig_m1_ui_s4'" , size(medsmall) color(gs0)) ///
	text(0.92  7 "{&Delta}=`delta_v5_s5'`sig_m1_ui_s5'" , size(medsmall) color(gs0)) ///
	ytitle("Pr(# Vaccine {&ge} a|Color)")  ///
	ylabel(, angle(0))                     ///
	legend(cols(2) order(1 "Child with Green Bracelet" 2 "Child with Yellow Bracelet"))   ///
	xtitle("")  subtitle("Panel A: Parents’ Inferences") name(perceived2)                  ///
	xlabel(1 "UI" 2 `" "S4"  "Vaccine 4" "' 3 "S5" 5 "UI" 6 `" "S4"  "Vaccine 5" "' 7 "S5", noticks)


	grc1leg ///
	perceived2 truth, legendfrom(perceived2)  subtitle("")
	graph export "${Replicate_SocialSignals_Figures}/Figure_ParentsInferences_Truth_CIs.jpg", replace




	********************************************************************************
	** End of the Dofile !!!
	********************************************************************************
